// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ForgeEntities.generated.cs" company="Open Trader">
//   Copyright (c) David Denis (david.denis@systemathics.com)
// </copyright>
// <summary>
//   |  Open Trader - The Open Source Systematic Trading Platform
//   |
//   |  This program is free software: you can redistribute it and/or modify
//   |  it under the terms of the GNU General Public License as published by
//   |  the Free Software Foundation, either version 2 of the License, or
//   |  (at your option) any later version.
//   |
//   |  This program is distributed in the hope that it will be useful,
//   |  but WITHOUT ANY WARRANTY; without even the implied warranty of
//   |  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   |  GNU General Public License for more details.
//   |
//   |  You should have received a copy of the GNU General Public License
//   |  along with this program.  If not, see http://www.gnu.org/licenses
//   |
//   |  Up to date informations about Open Trader can be found at :
//   |    http://opentrader.org
//   |    http://opentrader.codeplex.com
//   |
//   |  For professional services, please visit us at :
//   |    http://www.systemathics.com
// </summary>
// --------------------------------------------------------------------------------------------------------------------

#region Usings

using System.Data.Mapping;

using Edm_EntityMappingGeneratedViews;

#endregion

[assembly: EntityViewGeneration(typeof(ViewsForBaseEntitySets726653149531580EC4AB9B2ABA4C0B19))]

namespace Edm_EntityMappingGeneratedViews
{
    #region Usings

    using System;
    using System.Collections.Generic;
    using System.Data.Mapping;

    #endregion

    /// <summary>
    /// The views for base entity sets 726653149531580 e c 4 a b 9 b 2 ab a 4 c 0 b 19.
    /// </summary>
    /// <Summary>
    /// The type contains views for EntitySets and AssociationSets that were generated at design time.
    /// </Summary>
    public sealed class ViewsForBaseEntitySets726653149531580EC4AB9B2ABA4C0B19 : EntityViewContainer
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ViewsForBaseEntitySets726653149531580EC4AB9B2ABA4C0B19"/> class. 
        /// The views for base entity sets 726653149531580 e c 4 a b 9 b 2 ab a 4 c 0 b 19.
        /// </summary>
        /// <Summary>
        /// The constructor stores the views for the extents and also the hash values generated based on the metadata and mapping closure and views
        /// </Summary>
        public ViewsForBaseEntitySets726653149531580EC4AB9B2ABA4C0B19()
        {
            this.EdmEntityContainerName = "OpenTrader_ForgeEntities";
            this.StoreEntityContainerName = "OpenTrader_ForgeModelStoreContainer";
            this.HashOverMappingClosure = "5820803babbfba951419857907fa72e8";
            this.HashOverAllExtentViews = "b7265dfa6770b9294e602f157d00bf79";
            this.ViewCount = 53;
        }

        #endregion

        // The method returns the view for the index given.
        #region Methods

        /// <summary>
        /// The get view at.
        /// </summary>
        /// <param name="index">
        /// The index.
        /// </param>
        /// <returns>
        /// </returns>
        /// <exception cref="IndexOutOfRangeException">
        /// </exception>
        protected override KeyValuePair<string, string> GetViewAt(int index)
        {
            if (index == 0)
            {
                // return view for OpenTrader_ForgeModelStoreContainer.DBBackOffice
                return new KeyValuePair<string, string>(
                    "OpenTrader_ForgeModelStoreContainer.DBBackOffice", 
                    @"
    SELECT VALUE -- Constructing DBBackOffice
        [OpenTrader_ForgeModel.Store].DBBackOffice(T_0_1.DBBackOffice_ID)
    FROM (
        SELECT 
            T_0.ID AS DBBackOffice_ID, 
            True AS _from0
        FROM OpenTrader_ForgeEntities.DBBackOffice AS T_0
    ) AS T_0_1");
            }
            else
            {
                if ((index == 1))
                {
                    // return view for OpenTrader_ForgeModelStoreContainer.DBInventory
                    return new KeyValuePair<string, string>(
                        "OpenTrader_ForgeModelStoreContainer.DBInventory", 
                        @"
    SELECT VALUE -- Constructing DBInventory
        [OpenTrader_ForgeModel.Store].DBInventory(T3.DBInventory_ID, T3.DBInventory_DBBackOfficeID, T3.DBInventory_DBExecutionContextINodeID, T3.DBInventory_Date)
    FROM (
        SELECT T_0_1.DBInventory_ID, T_0_1.DBInventory_DBBackOfficeID, T_0_2.DBInventory_DBExecutionContextINodeID, T_0_2.DBInventory_Date, T_0_2._from0, T_0_1._from1
        FROM  (
            SELECT 
                Key(T_0.DBInventory).ID AS DBInventory_ID, 
                Key(T_0.DBBackOffice).ID AS DBInventory_DBBackOfficeID, 
                True AS _from1
            FROM OpenTrader_ForgeEntities.FK__DBInvento__DBBac__10566F31 AS T_0) AS T_0_1
            INNER JOIN (
            SELECT 
                T_0.ID AS DBInventory_ID, 
                T_0.DBExecutionContextINodeID AS DBInventory_DBExecutionContextINodeID, 
                T_0.Date AS DBInventory_Date, 
                True AS _from0
            FROM OpenTrader_ForgeEntities.DBInventory AS T_0) AS T_0_2
            ON T_0_1.DBInventory_ID = T_0_2.DBInventory_ID
    ) AS T3");
                }
                else
                {
                    if ((index == 2))
                    {
                        // return view for OpenTrader_ForgeModelStoreContainer.DBInventoryEntry
                        return new KeyValuePair<string, string>(
                            "OpenTrader_ForgeModelStoreContainer.DBInventoryEntry", 
                            "\r\n    SELECT VALUE -- Constructing DBInventoryEntry\r\n        [OpenTrader_ForgeMod" +
                            "el.Store].DBInventoryEntry(T3.DBInventoryEntry_ID, T3.DBInventoryEntry_DBInvento" +
                            "ryID, T3.DBInventoryEntry_DBInstrumentStaticDataID, T3.DBInventoryEntry_Quantity" +
                            "Buy, T3.DBInventoryEntry_AvgPriceBuy, T3.DBInventoryEntry_QuantitySell, T3.DBInv" +
                            "entoryEntry_AvgPriceSell)\r\n    FROM (\r\n        SELECT T_0_1.DBInventoryEntry_ID," +
                            " T_0_1.DBInventoryEntry_DBInventoryID, T_0_2.DBInventoryEntry_DBInstrumentStatic" +
                            "DataID, T_0_2.DBInventoryEntry_QuantityBuy, T_0_2.DBInventoryEntry_AvgPriceBuy, " +
                            "T_0_2.DBInventoryEntry_QuantitySell, T_0_2.DBInventoryEntry_AvgPriceSell, T_0_2." +
                            "_from0, T_0_1._from1\r\n        FROM  (\r\n            SELECT \r\n                Key(" +
                            "T_0.DBInventoryEntry).ID AS DBInventoryEntry_ID, \r\n                Key(T_0.DBInv" +
                            "entory).ID AS DBInventoryEntry_DBInventoryID, \r\n                True AS _from1\r\n" +
                            "            FROM OpenTrader_ForgeEntities.FK__DBInvento__DBInv__0F624AF8 AS T_0)" +
                            " AS T_0_1\r\n            INNER JOIN (\r\n            SELECT \r\n                T_0.ID" +
                            " AS DBInventoryEntry_ID, \r\n                T_0.DBInstrumentStaticDataID AS DBInv" +
                            "entoryEntry_DBInstrumentStaticDataID, \r\n                T_0.QuantityBuy AS DBInv" +
                            "entoryEntry_QuantityBuy, \r\n                T_0.AvgPriceBuy AS DBInventoryEntry_A" +
                            "vgPriceBuy, \r\n                T_0.QuantitySell AS DBInventoryEntry_QuantitySell," +
                            " \r\n                T_0.AvgPriceSell AS DBInventoryEntry_AvgPriceSell, \r\n        " +
                            "        True AS _from0\r\n            FROM OpenTrader_ForgeEntities.DBInventoryEnt" +
                            "ry AS T_0) AS T_0_2\r\n            ON T_0_1.DBInventoryEntry_ID = T_0_2.DBInventor" + "yEntry_ID\r\n    ) AS T3");
                    }
                    else
                    {
                        if ((index == 3))
                        {
                            // return view for OpenTrader_ForgeModelStoreContainer.DBOrder
                            return new KeyValuePair<string, string>(
                                "OpenTrader_ForgeModelStoreContainer.DBOrder", 
                                "\r\n    SELECT VALUE -- Constructing DBOrder\r\n        [OpenTrader_ForgeModel.Store]" +
                                ".DBOrder(T3.DBOrder_ID, T3.DBOrder_DBBackOfficeID, T3.DBOrder_DBExecutionContext" +
                                "INodeID, T3.DBOrder_DBInstrumentStaticDataID, T3.DBOrder_Quantity, T3.DBOrder_Pr" +
                                "ice, T3.DBOrder_Way, T3.DBOrder_Type, T3.DBOrder_TimeStamp)\r\n    FROM (\r\n       " +
                                " SELECT T_0_1.DBOrder_ID, T_0_1.DBOrder_DBBackOfficeID, T_0_2.DBOrder_DBExecutio" +
                                "nContextINodeID, T_0_2.DBOrder_DBInstrumentStaticDataID, T_0_2.DBOrder_Quantity," +
                                " T_0_2.DBOrder_Price, T_0_2.DBOrder_Way, T_0_2.DBOrder_Type, T_0_2.DBOrder_TimeS" +
                                "tamp, T_0_2._from0, T_0_1._from1\r\n        FROM  (\r\n            SELECT \r\n        " +
                                "        Key(T_0.DBOrder).ID AS DBOrder_ID, \r\n                Key(T_0.DBBackOffic" +
                                "e).ID AS DBOrder_DBBackOfficeID, \r\n                True AS _from1\r\n            F" +
                                "ROM OpenTrader_ForgeEntities.FK__DBOrder__DBBackO__46E78A0C AS T_0) AS T_0_1\r\n  " +
                                "          INNER JOIN (\r\n            SELECT \r\n                T_0.ID AS DBOrder_I" +
                                "D, \r\n                T_0.DBExecutionContextINodeID AS DBOrder_DBExecutionContext" +
                                "INodeID, \r\n                T_0.DBInstrumentStaticDataID AS DBOrder_DBInstrumentS" +
                                "taticDataID, \r\n                T_0.Quantity AS DBOrder_Quantity, \r\n             " +
                                "   T_0.Price AS DBOrder_Price, \r\n                T_0.Way AS DBOrder_Way, \r\n     " +
                                "           T_0.Type AS DBOrder_Type, \r\n                T_0.TimeStamp AS DBOrder_" +
                                "TimeStamp, \r\n                True AS _from0\r\n            FROM OpenTrader_ForgeEn" +
                                "tities.DBOrder AS T_0) AS T_0_2\r\n            ON T_0_1.DBOrder_ID = T_0_2.DBOrder" + "_ID\r\n    ) AS T3");
                        }
                        else
                        {
                            if ((index == 4))
                            {
                                // return view for OpenTrader_ForgeModelStoreContainer.DBOrderExecution
                                return new KeyValuePair<string, string>(
                                    "OpenTrader_ForgeModelStoreContainer.DBOrderExecution", 
                                    @"
    SELECT VALUE -- Constructing DBOrderExecution
        [OpenTrader_ForgeModel.Store].DBOrderExecution(T3.DBOrderExecution_ID, T3.DBOrderExecution_DBOrderID, T3.DBOrderExecution_Quantity, T3.DBOrderExecution_Price, T3.DBOrderExecution_TimeStamp, T3.DBOrderExecution_CounterParty)
    FROM (
        SELECT T_0_1.DBOrderExecution_ID, T_0_1.DBOrderExecution_DBOrderID, T_0_2.DBOrderExecution_Quantity, T_0_2.DBOrderExecution_Price, T_0_2.DBOrderExecution_TimeStamp, T_0_2.DBOrderExecution_CounterParty, T_0_2._from0, T_0_1._from1
        FROM  (
            SELECT 
                Key(T_0.DBOrderExecution).ID AS DBOrderExecution_ID, 
                Key(T_0.DBOrder).ID AS DBOrderExecution_DBOrderID, 
                True AS _from1
            FROM OpenTrader_ForgeEntities.FK__DBOrderEx__DBOrd__47DBAE45 AS T_0) AS T_0_1
            INNER JOIN (
            SELECT 
                T_0.ID AS DBOrderExecution_ID, 
                T_0.Quantity AS DBOrderExecution_Quantity, 
                T_0.Price AS DBOrderExecution_Price, 
                T_0.TimeStamp AS DBOrderExecution_TimeStamp, 
                T_0.CounterParty AS DBOrderExecution_CounterParty, 
                True AS _from0
            FROM OpenTrader_ForgeEntities.DBOrderExecution AS T_0) AS T_0_2
            ON T_0_1.DBOrderExecution_ID = T_0_2.DBOrderExecution_ID
    ) AS T3");
                            }
                            else
                            {
                                if ((index == 5))
                                {
                                    // return view for OpenTrader_ForgeModelStoreContainer.DBOrderStatus
                                    return new KeyValuePair<string, string>(
                                        "OpenTrader_ForgeModelStoreContainer.DBOrderStatus", 
                                        @"
    SELECT VALUE -- Constructing DBOrderStatus
        [OpenTrader_ForgeModel.Store].DBOrderStatus(T3.DBOrderStatus_ID, T3.DBOrderStatus_DBOrderID, T3.DBOrderStatus_Status, T3.DBOrderStatus_TimeStamp)
    FROM (
        SELECT T_0_1.DBOrderStatus_ID, T_0_1.DBOrderStatus_DBOrderID, T_0_2.DBOrderStatus_Status, T_0_2.DBOrderStatus_TimeStamp, T_0_2._from0, T_0_1._from1
        FROM  (
            SELECT 
                Key(T_0.DBOrderStatus).ID AS DBOrderStatus_ID, 
                Key(T_0.DBOrder).ID AS DBOrderStatus_DBOrderID, 
                True AS _from1
            FROM OpenTrader_ForgeEntities.FK__DBOrderSt__DBOrd__48CFD27E AS T_0) AS T_0_1
            INNER JOIN (
            SELECT 
                T_0.ID AS DBOrderStatus_ID, 
                T_0.Status AS DBOrderStatus_Status, 
                T_0.TimeStamp AS DBOrderStatus_TimeStamp, 
                True AS _from0
            FROM OpenTrader_ForgeEntities.DBOrderStatus AS T_0) AS T_0_2
            ON T_0_1.DBOrderStatus_ID = T_0_2.DBOrderStatus_ID
    ) AS T3");
                                }
                                else
                                {
                                    if ((index == 6))
                                    {
                                        // return view for OpenTrader_ForgeEntities.DBBackOffice
                                        return new KeyValuePair<string, string>(
                                            "OpenTrader_ForgeEntities.DBBackOffice", 
                                            @"
    SELECT VALUE -- Constructing DBBackOffice
        OpenTrader_ForgeModel.DBBackOffice(T_0_1.DBBackOffice_ID)
    FROM (
        SELECT 
            T_0.ID AS DBBackOffice_ID, 
            True AS _from0
        FROM OpenTrader_ForgeModelStoreContainer.DBBackOffice AS T_0
    ) AS T_0_1");
                                    }
                                    else
                                    {
                                        if ((index == 7))
                                        {
                                            // return view for OpenTrader_ForgeEntities.DBInventory
                                            return new KeyValuePair<string, string>(
                                                "OpenTrader_ForgeEntities.DBInventory", 
                                                @"
    SELECT VALUE -- Constructing DBInventory
        OpenTrader_ForgeModel.DBInventory(T_0_1.DBInventory_ID, T_0_1.DBInventory_DBExecutionContextINodeID, T_0_1.DBInventory_Date) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_ForgeEntities.DBBackOffice, ROW(T_0_1.[FK__DBInvento__DBBac__10566F31.DBBackOffice.ID]),OpenTrader_ForgeModel.DBBackOffice),OpenTrader_ForgeModel.FK__DBInvento__DBBac__10566F31,DBInventory,DBBackOffice) 
    FROM (
        SELECT 
            T_0.ID AS DBInventory_ID, 
            T_0.DBExecutionContextINodeID AS DBInventory_DBExecutionContextINodeID, 
            T_0.Date AS DBInventory_Date, 
            True AS _from0, 
            T_0.DBBackOfficeID AS [FK__DBInvento__DBBac__10566F31.DBBackOffice.ID]
        FROM OpenTrader_ForgeModelStoreContainer.DBInventory AS T_0
    ) AS T_0_1");
                                        }
                                        else
                                        {
                                            if ((index == 8))
                                            {
                                                // return view for OpenTrader_ForgeEntities.DBInventoryEntry
                                                return new KeyValuePair<string, string>(
                                                    "OpenTrader_ForgeEntities.DBInventoryEntry", 
                                                    @"
    SELECT VALUE -- Constructing DBInventoryEntry
        OpenTrader_ForgeModel.DBInventoryEntry(T_0_1.DBInventoryEntry_ID, T_0_1.DBInventoryEntry_DBInstrumentStaticDataID, T_0_1.DBInventoryEntry_QuantityBuy, T_0_1.DBInventoryEntry_AvgPriceBuy, T_0_1.DBInventoryEntry_QuantitySell, T_0_1.DBInventoryEntry_AvgPriceSell) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_ForgeEntities.DBInventory, ROW(T_0_1.[FK__DBInvento__DBInv__0F624AF8.DBInventory.ID]),OpenTrader_ForgeModel.DBInventory),OpenTrader_ForgeModel.FK__DBInvento__DBInv__0F624AF8,DBInventoryEntry,DBInventory) 
    FROM (
        SELECT 
            T_0.ID AS DBInventoryEntry_ID, 
            T_0.DBInstrumentStaticDataID AS DBInventoryEntry_DBInstrumentStaticDataID, 
            T_0.QuantityBuy AS DBInventoryEntry_QuantityBuy, 
            T_0.AvgPriceBuy AS DBInventoryEntry_AvgPriceBuy, 
            T_0.QuantitySell AS DBInventoryEntry_QuantitySell, 
            T_0.AvgPriceSell AS DBInventoryEntry_AvgPriceSell, 
            True AS _from0, 
            T_0.DBInventoryID AS [FK__DBInvento__DBInv__0F624AF8.DBInventory.ID]
        FROM OpenTrader_ForgeModelStoreContainer.DBInventoryEntry AS T_0
    ) AS T_0_1");
                                            }
                                            else
                                            {
                                                if ((index == 9))
                                                {
                                                    // return view for OpenTrader_ForgeEntities.DBOrder
                                                    return new KeyValuePair<string, string>(
                                                        "OpenTrader_ForgeEntities.DBOrder", 
                                                        @"
    SELECT VALUE -- Constructing DBOrder
        OpenTrader_ForgeModel.DBOrder(T_0_1.DBOrder_ID, T_0_1.DBOrder_DBExecutionContextINodeID, T_0_1.DBOrder_DBInstrumentStaticDataID, T_0_1.DBOrder_Quantity, T_0_1.DBOrder_Price, T_0_1.DBOrder_Way, T_0_1.DBOrder_Type, T_0_1.DBOrder_TimeStamp) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_ForgeEntities.DBBackOffice, ROW(T_0_1.[FK__DBOrder__DBBackO__46E78A0C.DBBackOffice.ID]),OpenTrader_ForgeModel.DBBackOffice),OpenTrader_ForgeModel.FK__DBOrder__DBBackO__46E78A0C,DBOrder,DBBackOffice) 
    FROM (
        SELECT 
            T_0.ID AS DBOrder_ID, 
            T_0.DBExecutionContextINodeID AS DBOrder_DBExecutionContextINodeID, 
            T_0.DBInstrumentStaticDataID AS DBOrder_DBInstrumentStaticDataID, 
            T_0.Quantity AS DBOrder_Quantity, 
            T_0.Price AS DBOrder_Price, 
            T_0.Way AS DBOrder_Way, 
            T_0.Type AS DBOrder_Type, 
            T_0.TimeStamp AS DBOrder_TimeStamp, 
            True AS _from0, 
            T_0.DBBackOfficeID AS [FK__DBOrder__DBBackO__46E78A0C.DBBackOffice.ID]
        FROM OpenTrader_ForgeModelStoreContainer.DBOrder AS T_0
    ) AS T_0_1");
                                                }
                                                else
                                                {
                                                    if ((index == 10))
                                                    {
                                                        // return view for OpenTrader_ForgeEntities.DBOrderExecution
                                                        return new KeyValuePair<string, string>(
                                                            "OpenTrader_ForgeEntities.DBOrderExecution", 
                                                            @"
    SELECT VALUE -- Constructing DBOrderExecution
        OpenTrader_ForgeModel.DBOrderExecution(T_0_1.DBOrderExecution_ID, T_0_1.DBOrderExecution_Quantity, T_0_1.DBOrderExecution_Price, T_0_1.DBOrderExecution_TimeStamp, T_0_1.DBOrderExecution_CounterParty) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_ForgeEntities.DBOrder, ROW(T_0_1.[FK__DBOrderEx__DBOrd__47DBAE45.DBOrder.ID]),OpenTrader_ForgeModel.DBOrder),OpenTrader_ForgeModel.FK__DBOrderEx__DBOrd__47DBAE45,DBOrderExecution,DBOrder) 
    FROM (
        SELECT 
            T_0.ID AS DBOrderExecution_ID, 
            T_0.Quantity AS DBOrderExecution_Quantity, 
            T_0.Price AS DBOrderExecution_Price, 
            T_0.TimeStamp AS DBOrderExecution_TimeStamp, 
            T_0.CounterParty AS DBOrderExecution_CounterParty, 
            True AS _from0, 
            T_0.DBOrderID AS [FK__DBOrderEx__DBOrd__47DBAE45.DBOrder.ID]
        FROM OpenTrader_ForgeModelStoreContainer.DBOrderExecution AS T_0
    ) AS T_0_1");
                                                    }
                                                    else
                                                    {
                                                        if ((index == 11))
                                                        {
                                                            // return view for OpenTrader_ForgeEntities.DBOrderStatus
                                                            return new KeyValuePair<string, string>(
                                                                "OpenTrader_ForgeEntities.DBOrderStatus", 
                                                                @"
    SELECT VALUE -- Constructing DBOrderStatus
        OpenTrader_ForgeModel.DBOrderStatus(T_0_1.DBOrderStatus_ID, T_0_1.DBOrderStatus_Status, T_0_1.DBOrderStatus_TimeStamp) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_ForgeEntities.DBOrder, ROW(T_0_1.[FK__DBOrderSt__DBOrd__48CFD27E.DBOrder.ID]),OpenTrader_ForgeModel.DBOrder),OpenTrader_ForgeModel.FK__DBOrderSt__DBOrd__48CFD27E,DBOrderStatus,DBOrder) 
    FROM (
        SELECT 
            T_0.ID AS DBOrderStatus_ID, 
            T_0.Status AS DBOrderStatus_Status, 
            T_0.TimeStamp AS DBOrderStatus_TimeStamp, 
            True AS _from0, 
            T_0.DBOrderID AS [FK__DBOrderSt__DBOrd__48CFD27E.DBOrder.ID]
        FROM OpenTrader_ForgeModelStoreContainer.DBOrderStatus AS T_0
    ) AS T_0_1");
                                                        }
                                                        else
                                                        {
                                                            if ((index == 12))
                                                            {
                                                                // return view for OpenTrader_ForgeEntities.FK__DBInvento__DBBac__10566F31
                                                                return
                                                                    new KeyValuePair<string, string>(
                                                                        "OpenTrader_ForgeEntities.FK__DBInvento__DBBac__10566F31", 
                                                                        @"
    SELECT VALUE -- Constructing FK__DBInvento__DBBac__10566F31
        OpenTrader_ForgeModel.FK__DBInvento__DBBac__10566F31(T3.[FK__DBInvento__DBBac__10566F31.DBBackOffice], T3.[FK__DBInvento__DBBac__10566F31.DBInventory])
    FROM (
        SELECT -- Constructing DBBackOffice
            CreateRef(OpenTrader_ForgeEntities.DBBackOffice, row(T_0_2.[FK__DBInvento__DBBac__10566F31.DBBackOffice.ID]),OpenTrader_ForgeModel.DBBackOffice) AS [FK__DBInvento__DBBac__10566F31.DBBackOffice], 
            T_0_2.[FK__DBInvento__DBBac__10566F31.DBInventory]
        FROM (
            SELECT -- Constructing DBInventory
                CreateRef(OpenTrader_ForgeEntities.DBInventory, row(T_0_1.[FK__DBInvento__DBBac__10566F31.DBInventory.ID]),OpenTrader_ForgeModel.DBInventory) AS [FK__DBInvento__DBBac__10566F31.DBInventory], 
                T_0_1.[FK__DBInvento__DBBac__10566F31.DBBackOffice.ID]
            FROM (
                SELECT 
                    T_0.DBBackOfficeID AS [FK__DBInvento__DBBac__10566F31.DBBackOffice.ID], 
                    T_0.ID AS [FK__DBInvento__DBBac__10566F31.DBInventory.ID], 
                    True AS _from0
                FROM OpenTrader_ForgeModelStoreContainer.DBInventory AS T_0
            ) AS T_0_1
        ) AS T_0_2
    ) AS T3");
                                                            }
                                                            else
                                                            {
                                                                if ((index == 13))
                                                                {
                                                                    // return view for OpenTrader_ForgeEntities.FK__DBOrder__DBBackO__46E78A0C
                                                                    return
                                                                        new KeyValuePair<string, string>(
                                                                            "OpenTrader_ForgeEntities.FK__DBOrder__DBBackO__46E78A0C", 
                                                                            @"
    SELECT VALUE -- Constructing FK__DBOrder__DBBackO__46E78A0C
        OpenTrader_ForgeModel.FK__DBOrder__DBBackO__46E78A0C(T3.[FK__DBOrder__DBBackO__46E78A0C.DBBackOffice], T3.[FK__DBOrder__DBBackO__46E78A0C.DBOrder])
    FROM (
        SELECT -- Constructing DBBackOffice
            CreateRef(OpenTrader_ForgeEntities.DBBackOffice, row(T_0_2.[FK__DBOrder__DBBackO__46E78A0C.DBBackOffice.ID]),OpenTrader_ForgeModel.DBBackOffice) AS [FK__DBOrder__DBBackO__46E78A0C.DBBackOffice], 
            T_0_2.[FK__DBOrder__DBBackO__46E78A0C.DBOrder]
        FROM (
            SELECT -- Constructing DBOrder
                CreateRef(OpenTrader_ForgeEntities.DBOrder, row(T_0_1.[FK__DBOrder__DBBackO__46E78A0C.DBOrder.ID]),OpenTrader_ForgeModel.DBOrder) AS [FK__DBOrder__DBBackO__46E78A0C.DBOrder], 
                T_0_1.[FK__DBOrder__DBBackO__46E78A0C.DBBackOffice.ID]
            FROM (
                SELECT 
                    T_0.DBBackOfficeID AS [FK__DBOrder__DBBackO__46E78A0C.DBBackOffice.ID], 
                    T_0.ID AS [FK__DBOrder__DBBackO__46E78A0C.DBOrder.ID], 
                    True AS _from0
                FROM OpenTrader_ForgeModelStoreContainer.DBOrder AS T_0
            ) AS T_0_1
        ) AS T_0_2
    ) AS T3");
                                                                }
                                                                else
                                                                {
                                                                    if ((index == 14))
                                                                    {
                                                                        // return view for OpenTrader_ForgeEntities.FK__DBInvento__DBInv__0F624AF8
                                                                        return
                                                                            new KeyValuePair<string, string>(
                                                                                "OpenTrader_ForgeEntities.FK__DBInvento__DBInv__0F624AF8", 
                                                                                @"
    SELECT VALUE -- Constructing FK__DBInvento__DBInv__0F624AF8
        OpenTrader_ForgeModel.FK__DBInvento__DBInv__0F624AF8(T3.[FK__DBInvento__DBInv__0F624AF8.DBInventory], T3.[FK__DBInvento__DBInv__0F624AF8.DBInventoryEntry])
    FROM (
        SELECT -- Constructing DBInventory
            CreateRef(OpenTrader_ForgeEntities.DBInventory, row(T_0_2.[FK__DBInvento__DBInv__0F624AF8.DBInventory.ID]),OpenTrader_ForgeModel.DBInventory) AS [FK__DBInvento__DBInv__0F624AF8.DBInventory], 
            T_0_2.[FK__DBInvento__DBInv__0F624AF8.DBInventoryEntry]
        FROM (
            SELECT -- Constructing DBInventoryEntry
                CreateRef(OpenTrader_ForgeEntities.DBInventoryEntry, row(T_0_1.[FK__DBInvento__DBInv__0F624AF8.DBInventoryEntry.ID]),OpenTrader_ForgeModel.DBInventoryEntry) AS [FK__DBInvento__DBInv__0F624AF8.DBInventoryEntry], 
                T_0_1.[FK__DBInvento__DBInv__0F624AF8.DBInventory.ID]
            FROM (
                SELECT 
                    T_0.DBInventoryID AS [FK__DBInvento__DBInv__0F624AF8.DBInventory.ID], 
                    T_0.ID AS [FK__DBInvento__DBInv__0F624AF8.DBInventoryEntry.ID], 
                    True AS _from0
                FROM OpenTrader_ForgeModelStoreContainer.DBInventoryEntry AS T_0
            ) AS T_0_1
        ) AS T_0_2
    ) AS T3");
                                                                    }
                                                                    else
                                                                    {
                                                                        if ((index == 15))
                                                                        {
                                                                            // return view for OpenTrader_ForgeEntities.FK__DBOrderEx__DBOrd__47DBAE45
                                                                            return
                                                                                new KeyValuePair<string, string>(
                                                                                    "OpenTrader_ForgeEntities.FK__DBOrderEx__DBOrd__47DBAE45", 
                                                                                    @"
    SELECT VALUE -- Constructing FK__DBOrderEx__DBOrd__47DBAE45
        OpenTrader_ForgeModel.FK__DBOrderEx__DBOrd__47DBAE45(T3.[FK__DBOrderEx__DBOrd__47DBAE45.DBOrder], T3.[FK__DBOrderEx__DBOrd__47DBAE45.DBOrderExecution])
    FROM (
        SELECT -- Constructing DBOrder
            CreateRef(OpenTrader_ForgeEntities.DBOrder, row(T_0_2.[FK__DBOrderEx__DBOrd__47DBAE45.DBOrder.ID]),OpenTrader_ForgeModel.DBOrder) AS [FK__DBOrderEx__DBOrd__47DBAE45.DBOrder], 
            T_0_2.[FK__DBOrderEx__DBOrd__47DBAE45.DBOrderExecution]
        FROM (
            SELECT -- Constructing DBOrderExecution
                CreateRef(OpenTrader_ForgeEntities.DBOrderExecution, row(T_0_1.[FK__DBOrderEx__DBOrd__47DBAE45.DBOrderExecution.ID]),OpenTrader_ForgeModel.DBOrderExecution) AS [FK__DBOrderEx__DBOrd__47DBAE45.DBOrderExecution], 
                T_0_1.[FK__DBOrderEx__DBOrd__47DBAE45.DBOrder.ID]
            FROM (
                SELECT 
                    T_0.DBOrderID AS [FK__DBOrderEx__DBOrd__47DBAE45.DBOrder.ID], 
                    T_0.ID AS [FK__DBOrderEx__DBOrd__47DBAE45.DBOrderExecution.ID], 
                    True AS _from0
                FROM OpenTrader_ForgeModelStoreContainer.DBOrderExecution AS T_0
            ) AS T_0_1
        ) AS T_0_2
    ) AS T3");
                                                                        }
                                                                        else
                                                                        {
                                                                            if ((index == 16))
                                                                            {
                                                                                // return view for OpenTrader_ForgeEntities.FK__DBOrderSt__DBOrd__48CFD27E
                                                                                return
                                                                                    new KeyValuePair<string, string>(
                                                                                        "OpenTrader_ForgeEntities.FK__DBOrderSt__DBOrd__48CFD27E", 
                                                                                        @"
    SELECT VALUE -- Constructing FK__DBOrderSt__DBOrd__48CFD27E
        OpenTrader_ForgeModel.FK__DBOrderSt__DBOrd__48CFD27E(T3.[FK__DBOrderSt__DBOrd__48CFD27E.DBOrder], T3.[FK__DBOrderSt__DBOrd__48CFD27E.DBOrderStatus])
    FROM (
        SELECT -- Constructing DBOrder
            CreateRef(OpenTrader_ForgeEntities.DBOrder, row(T_0_2.[FK__DBOrderSt__DBOrd__48CFD27E.DBOrder.ID]),OpenTrader_ForgeModel.DBOrder) AS [FK__DBOrderSt__DBOrd__48CFD27E.DBOrder], 
            T_0_2.[FK__DBOrderSt__DBOrd__48CFD27E.DBOrderStatus]
        FROM (
            SELECT -- Constructing DBOrderStatus
                CreateRef(OpenTrader_ForgeEntities.DBOrderStatus, row(T_0_1.[FK__DBOrderSt__DBOrd__48CFD27E.DBOrderStatus.ID]),OpenTrader_ForgeModel.DBOrderStatus) AS [FK__DBOrderSt__DBOrd__48CFD27E.DBOrderStatus], 
                T_0_1.[FK__DBOrderSt__DBOrd__48CFD27E.DBOrder.ID]
            FROM (
                SELECT 
                    T_0.DBOrderID AS [FK__DBOrderSt__DBOrd__48CFD27E.DBOrder.ID], 
                    T_0.ID AS [FK__DBOrderSt__DBOrd__48CFD27E.DBOrderStatus.ID], 
                    True AS _from0
                FROM OpenTrader_ForgeModelStoreContainer.DBOrderStatus AS T_0
            ) AS T_0_1
        ) AS T_0_2
    ) AS T3");
                                                                            }
                                                                            else
                                                                            {
                                                                                if ((index == 17))
                                                                                {
                                                                                    // return view for OpenTrader_ForgeModelStoreContainer.DBAction
                                                                                    return
                                                                                        new KeyValuePair<string, string>(
                                                                                            "OpenTrader_ForgeModelStoreContainer.DBAction", 
                                                                                            @"
    SELECT VALUE -- Constructing DBAction
        [OpenTrader_ForgeModel.Store].DBAction(T_0_1.DBAction_ID, T_0_1.DBAction_Type, T_0_1.DBAction_DateCreation, T_0_1.DBAction_DateExercice, T_0_1.DBAction_Name, T_0_1.DBAction_DBInstrumentStaticDataID, T_0_1.DBAction_Enabled, T_0_1.DBAction_Ratio, T_0_1.DBAction_Quantity, T_0_1.DBAction_Price)
    FROM (
        SELECT 
            T_0.ID AS DBAction_ID, 
            T_0.Type AS DBAction_Type, 
            T_0.DateCreation AS DBAction_DateCreation, 
            T_0.DateExercice AS DBAction_DateExercice, 
            T_0.Name AS DBAction_Name, 
            T_0.DBInstrumentStaticDataID AS DBAction_DBInstrumentStaticDataID, 
            T_0.Enabled AS DBAction_Enabled, 
            T_0.Ratio AS DBAction_Ratio, 
            T_0.Quantity AS DBAction_Quantity, 
            T_0.Price AS DBAction_Price, 
            True AS _from0
        FROM OpenTrader_ForgeEntities.DBAction AS T_0
    ) AS T_0_1");
                                                                                }
                                                                                else
                                                                                {
                                                                                    if ((index == 18))
                                                                                    {
                                                                                        // return view for OpenTrader_ForgeEntities.DBAction
                                                                                        return
                                                                                            new KeyValuePair<string, string>(
                                                                                                "OpenTrader_ForgeEntities.DBAction", 
                                                                                                @"
    SELECT VALUE -- Constructing DBAction
        OpenTrader_ForgeModel.DBAction(T_0_1.DBAction_ID, T_0_1.DBAction_Type, T_0_1.DBAction_DateCreation, T_0_1.DBAction_DateExercice, T_0_1.DBAction_Name, T_0_1.DBAction_DBInstrumentStaticDataID, T_0_1.DBAction_Enabled, T_0_1.DBAction_Ratio, T_0_1.DBAction_Quantity, T_0_1.DBAction_Price)
    FROM (
        SELECT 
            T_0.ID AS DBAction_ID, 
            T_0.Type AS DBAction_Type, 
            T_0.DateCreation AS DBAction_DateCreation, 
            T_0.DateExercice AS DBAction_DateExercice, 
            T_0.Name AS DBAction_Name, 
            T_0.DBInstrumentStaticDataID AS DBAction_DBInstrumentStaticDataID, 
            T_0.Enabled AS DBAction_Enabled, 
            T_0.Ratio AS DBAction_Ratio, 
            T_0.Quantity AS DBAction_Quantity, 
            T_0.Price AS DBAction_Price, 
            True AS _from0
        FROM OpenTrader_ForgeModelStoreContainer.DBAction AS T_0
    ) AS T_0_1");
                                                                                    }
                                                                                    else
                                                                                    {
                                                                                        if ((index == 19))
                                                                                        {
                                                                                            // return view for OpenTrader_ForgeModelStoreContainer.DBCurrencyPrice
                                                                                            return
                                                                                                new KeyValuePair<string, string>(
                                                                                                    "OpenTrader_ForgeModelStoreContainer.DBCurrencyPrice", 
                                                                                                    @"
    SELECT VALUE -- Constructing DBCurrencyPrice
        [OpenTrader_ForgeModel.Store].DBCurrencyPrice(T3.DBCurrencyPrice_ID, T3.DBCurrencyPrice_DBDictionaryID, T3.DBCurrencyPrice_ForeignCurrency, T3.DBCurrencyPrice_CurrencyPrice, T3.[DBCurrencyPrice._InsertionStamp], T3.[DBCurrencyPrice._UpdateStamp])
    FROM (
        SELECT T_0_1.DBCurrencyPrice_ID, T_0_1.DBCurrencyPrice_DBDictionaryID, T_0_2.DBCurrencyPrice_ForeignCurrency, T_0_2.DBCurrencyPrice_CurrencyPrice, T_0_2.[DBCurrencyPrice._InsertionStamp], T_0_2.[DBCurrencyPrice._UpdateStamp], T_0_2._from0, T_0_1._from1
        FROM  (
            SELECT 
                Key(T_0.DBCurrencyPrice).ID AS DBCurrencyPrice_ID, 
                Key(T_0.DBDictionary).ID AS DBCurrencyPrice_DBDictionaryID, 
                True AS _from1
            FROM OpenTrader_ForgeEntities.FK__DBCurrenc__DBDic__49C3F6B7 AS T_0) AS T_0_1
            INNER JOIN (
            SELECT 
                T_0.ID AS DBCurrencyPrice_ID, 
                T_0.ForeignCurrency AS DBCurrencyPrice_ForeignCurrency, 
                T_0.CurrencyPrice AS DBCurrencyPrice_CurrencyPrice, 
                T_0.C_InsertionStamp AS [DBCurrencyPrice._InsertionStamp], 
                T_0.C_UpdateStamp AS [DBCurrencyPrice._UpdateStamp], 
                True AS _from0
            FROM OpenTrader_ForgeEntities.DBCurrencyPrice AS T_0) AS T_0_2
            ON T_0_1.DBCurrencyPrice_ID = T_0_2.DBCurrencyPrice_ID
    ) AS T3");
                                                                                        }
                                                                                        else
                                                                                        {
                                                                                            if ((index == 20))
                                                                                            {
                                                                                                // return view for OpenTrader_ForgeModelStoreContainer.DBDictionary
                                                                                                return
                                                                                                    new KeyValuePair<string, string>(
                                                                                                        "OpenTrader_ForgeModelStoreContainer.DBDictionary", 
                                                                                                        @"
    SELECT VALUE -- Constructing DBDictionary
        [OpenTrader_ForgeModel.Store].DBDictionary(T_0_1.DBDictionary_ID, T_0_1.DBDictionary_DomesticCurrency)
    FROM (
        SELECT 
            T_0.ID AS DBDictionary_ID, 
            T_0.DomesticCurrency AS DBDictionary_DomesticCurrency, 
            True AS _from0
        FROM OpenTrader_ForgeEntities.DBDictionary AS T_0
    ) AS T_0_1");
                                                                                            }
                                                                                            else
                                                                                            {
                                                                                                if ((index == 21))
                                                                                                {
                                                                                                    // return view for OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticData
                                                                                                    return
                                                                                                        new KeyValuePair<string, string>(
                                                                                                            "OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticData", 
                                                                                                            "\r\n    SELECT VALUE -- Constructing DBInstrumentStaticData\r\n        [OpenTrader_Fo" +
                                                                                                            "rgeModel.Store].DBInstrumentStaticData(T7.DBInstrumentStaticData_ID, T7.DBInstru" +
                                                                                                            "mentStaticData_DBMarketID, T7.DBInstrumentStaticData_Type, T7.DBInstrumentStatic" +
                                                                                                            "Data_Name, T7.DBInstrumentStaticData_Code, T7.DBInstrumentStaticData_ISIN, T7.DB" +
                                                                                                            "InstrumentStaticData_TradingScope, T7.DBInstrumentStaticData_Currency, T7.DBInst" +
                                                                                                            "rumentStaticData_DBTickSizeRuleID, T7.DBInstrumentStaticData_DBFeedPluginID, T7." +
                                                                                                            "DBInstrumentStaticData_DBFeedPluginInstrumentStaticDataConfigurationID, T7.DBIns" +
                                                                                                            "trumentStaticData_DBOrderPluginID, T7.DBInstrumentStaticData_DBOrderPluginInstru" +
                                                                                                            "mentStaticDataConfigurationID, T7.DBInstrumentStaticData_PointValue, T7.DBInstru" +
                                                                                                            "mentStaticData_LotSize, T7.DBInstrumentStaticData_Enabled, T7.DBInstrumentStatic" +
                                                                                                            "Data_BuyEnabled, T7.DBInstrumentStaticData_SellEnabled, T7.DBInstrumentStaticDat" +
                                                                                                            "a_ShortSellEnabled, T7.DBInstrumentStaticData_BlackListed, T7.DBInstrumentStatic" +
                                                                                                            "Data_HardToBorrow, T7.DBInstrumentStaticData_Restricted, T7.DBInstrumentStaticDa" +
                                                                                                            "ta_MaxNominalTrade, T7.DBInstrumentStaticData_MaxNominalBook, T7.DBInstrumentSta" +
                                                                                                            "ticData_MaxVariationPercentage, T7.DBInstrumentStaticData_Currency2, T7.DBInstru" +
                                                                                                            "mentStaticData_Sector, T7.DBInstrumentStaticData_Maturity, T7.DBInstrumentStatic" +
                                                                                                            "Data_Tenor, T7.DBInstrumentStaticData_Strike, T7.DBInstrumentStaticData_K, T7.DB" +
                                                                                                            "InstrumentStaticData_K1, T7.DBInstrumentStaticData_K2, T7.DBInstrumentStaticData" +
                                                                                                            "_T, T7.DBInstrumentStaticData_T1, T7.DBInstrumentStaticData_T2, T7.DBInstrumentS" +
                                                                                                            "taticData_DBUnderlyingID, T7.DBInstrumentStaticData_DBUnderlying1ID, T7.DBInstru" +
                                                                                                            "mentStaticData_DBUnderlying2ID, T7.DBInstrumentStaticData_OptionType, T7.DBInstr" +
                                                                                                            "umentStaticData_BarrierType, T7.DBInstrumentStaticData_ExerciseType, T7.[DBInstr" +
                                                                                                            "umentStaticData._InsertionStamp], T7.[DBInstrumentStaticData._UpdateStamp])\r\n   " +
                                                                                                            " FROM (\r\n        SELECT T3.DBInstrumentStaticData_ID, T3.DBInstrumentStaticData_" +
                                                                                                            "DBMarketID, T3.DBInstrumentStaticData_Type, T3.DBInstrumentStaticData_Name, T3.D" +
                                                                                                            "BInstrumentStaticData_Code, T3.DBInstrumentStaticData_ISIN, T3.DBInstrumentStati" +
                                                                                                            "cData_TradingScope, T3.DBInstrumentStaticData_Currency, T3.DBInstrumentStaticDat" +
                                                                                                            "a_DBTickSizeRuleID, T3.DBInstrumentStaticData_DBFeedPluginID, T3.DBInstrumentSta" +
                                                                                                            "ticData_DBFeedPluginInstrumentStaticDataConfigurationID, T3.DBInstrumentStaticDa" +
                                                                                                            "ta_DBOrderPluginID, T3.DBInstrumentStaticData_DBOrderPluginInstrumentStaticDataC" +
                                                                                                            "onfigurationID, T3.DBInstrumentStaticData_PointValue, T3.DBInstrumentStaticData_" +
                                                                                                            "LotSize, T3.DBInstrumentStaticData_Enabled, T3.DBInstrumentStaticData_BuyEnabled" +
                                                                                                            ", T3.DBInstrumentStaticData_SellEnabled, T3.DBInstrumentStaticData_ShortSellEnab" +
                                                                                                            "led, T3.DBInstrumentStaticData_BlackListed, T3.DBInstrumentStaticData_HardToBorr" +
                                                                                                            "ow, T3.DBInstrumentStaticData_Restricted, T3.DBInstrumentStaticData_MaxNominalTr" +
                                                                                                            "ade, T3.DBInstrumentStaticData_MaxNominalBook, T3.DBInstrumentStaticData_MaxVari" +
                                                                                                            "ationPercentage, T3.DBInstrumentStaticData_Currency2, T3.DBInstrumentStaticData_" +
                                                                                                            "Sector, T3.DBInstrumentStaticData_Maturity, T3.DBInstrumentStaticData_Tenor, T3." +
                                                                                                            "DBInstrumentStaticData_Strike, T3.DBInstrumentStaticData_K, T3.DBInstrumentStati" +
                                                                                                            "cData_K1, T3.DBInstrumentStaticData_K2, T3.DBInstrumentStaticData_T, T3.DBInstru" +
                                                                                                            "mentStaticData_T1, T3.DBInstrumentStaticData_T2, T6.DBInstrumentStaticData_DBUnd" +
                                                                                                            "erlyingID, T4.DBInstrumentStaticData_DBUnderlying1ID, T5.DBInstrumentStaticData_" +
                                                                                                            "DBUnderlying2ID, T3.DBInstrumentStaticData_OptionType, T3.DBInstrumentStaticData" +
                                                                                                            "_BarrierType, T3.DBInstrumentStaticData_ExerciseType, T3.[DBInstrumentStaticData" +
                                                                                                            "._InsertionStamp], T3.[DBInstrumentStaticData._UpdateStamp], T3._from0, T3._from" +
                                                                                                            "1, (T6._from2 AND T6._from2 IS NOT NULL) AS _from2, (T4._from3 AND T4._from3 IS " +
                                                                                                            "NOT NULL) AS _from3, (T5._from4 AND T5._from4 IS NOT NULL) AS _from4\r\n        FR" +
                                                                                                            "OM  (\r\n            SELECT T_0_1.DBInstrumentStaticData_ID, T_0_2.DBInstrumentSta" +
                                                                                                            "ticData_DBMarketID, T_0_1.DBInstrumentStaticData_Type, T_0_1.DBInstrumentStaticD" +
                                                                                                            "ata_Name, T_0_1.DBInstrumentStaticData_Code, T_0_1.DBInstrumentStaticData_ISIN, " +
                                                                                                            "T_0_1.DBInstrumentStaticData_TradingScope, T_0_1.DBInstrumentStaticData_Currency" +
                                                                                                            ", T_0_1.DBInstrumentStaticData_DBTickSizeRuleID, T_0_1.DBInstrumentStaticData_DB" +
                                                                                                            "FeedPluginID, T_0_1.DBInstrumentStaticData_DBFeedPluginInstrumentStaticDataConfi" +
                                                                                                            "gurationID, T_0_1.DBInstrumentStaticData_DBOrderPluginID, T_0_1.DBInstrumentStat" +
                                                                                                            "icData_DBOrderPluginInstrumentStaticDataConfigurationID, T_0_1.DBInstrumentStati" +
                                                                                                            "cData_PointValue, T_0_1.DBInstrumentStaticData_LotSize, T_0_1.DBInstrumentStatic" +
                                                                                                            "Data_Enabled, T_0_1.DBInstrumentStaticData_BuyEnabled, T_0_1.DBInstrumentStaticD" +
                                                                                                            "ata_SellEnabled, T_0_1.DBInstrumentStaticData_ShortSellEnabled, T_0_1.DBInstrume" +
                                                                                                            "ntStaticData_BlackListed, T_0_1.DBInstrumentStaticData_HardToBorrow, T_0_1.DBIns" +
                                                                                                            "trumentStaticData_Restricted, T_0_1.DBInstrumentStaticData_MaxNominalTrade, T_0_" +
                                                                                                            "1.DBInstrumentStaticData_MaxNominalBook, T_0_1.DBInstrumentStaticData_MaxVariati" +
                                                                                                            "onPercentage, T_0_1.DBInstrumentStaticData_Currency2, T_0_1.DBInstrumentStaticDa" +
                                                                                                            "ta_Sector, T_0_1.DBInstrumentStaticData_Maturity, T_0_1.DBInstrumentStaticData_T" +
                                                                                                            "enor, T_0_1.DBInstrumentStaticData_Strike, T_0_1.DBInstrumentStaticData_K, T_0_1" +
                                                                                                            ".DBInstrumentStaticData_K1, T_0_1.DBInstrumentStaticData_K2, T_0_1.DBInstrumentS" +
                                                                                                            "taticData_T, T_0_1.DBInstrumentStaticData_T1, T_0_1.DBInstrumentStaticData_T2, T" +
                                                                                                            "_0_1.DBInstrumentStaticData_OptionType, T_0_1.DBInstrumentStaticData_BarrierType" +
                                                                                                            ", T_0_1.DBInstrumentStaticData_ExerciseType, T_0_1.[DBInstrumentStaticData._Inse" +
                                                                                                            "rtionStamp], T_0_1.[DBInstrumentStaticData._UpdateStamp], T_0_1._from0, T_0_2._f" +
                                                                                                            "rom1\r\n            FROM  (\r\n                SELECT \r\n                    T_0.ID A" +
                                                                                                            "S DBInstrumentStaticData_ID, \r\n                    T_0.Type AS DBInstrumentStati" +
                                                                                                            "cData_Type, \r\n                    T_0.Name AS DBInstrumentStaticData_Name, \r\n   " +
                                                                                                            "                 T_0.Code AS DBInstrumentStaticData_Code, \r\n                    " +
                                                                                                            "T_0.ISIN AS DBInstrumentStaticData_ISIN, \r\n                    T_0.TradingScope " +
                                                                                                            "AS DBInstrumentStaticData_TradingScope, \r\n                    T_0.Currency AS DB" +
                                                                                                            "InstrumentStaticData_Currency, \r\n                    T_0.DBTickSizeRuleID AS DBI" +
                                                                                                            "nstrumentStaticData_DBTickSizeRuleID, \r\n                    T_0.DBFeedPluginID A" +
                                                                                                            "S DBInstrumentStaticData_DBFeedPluginID, \r\n                    T_0.DBFeedPluginI" +
                                                                                                            "nstrumentStaticDataConfigurationID AS DBInstrumentStaticData_DBFeedPluginInstrum" +
                                                                                                            "entStaticDataConfigurationID, \r\n                    T_0.DBOrderPluginID AS DBIns" +
                                                                                                            "trumentStaticData_DBOrderPluginID, \r\n                    T_0.DBOrderPluginInstru" +
                                                                                                            "mentStaticDataConfigurationID AS DBInstrumentStaticData_DBOrderPluginInstrumentS" +
                                                                                                            "taticDataConfigurationID, \r\n                    T_0.PointValue AS DBInstrumentSt" +
                                                                                                            "aticData_PointValue, \r\n                    T_0.LotSize AS DBInstrumentStaticData" +
                                                                                                            "_LotSize, \r\n                    T_0.Enabled AS DBInstrumentStaticData_Enabled, \r" +
                                                                                                            "\n                    T_0.BuyEnabled AS DBInstrumentStaticData_BuyEnabled, \r\n    " +
                                                                                                            "                T_0.SellEnabled AS DBInstrumentStaticData_SellEnabled, \r\n       " +
                                                                                                            "             T_0.ShortSellEnabled AS DBInstrumentStaticData_ShortSellEnabled, \r\n" +
                                                                                                            "                    T_0.BlackListed AS DBInstrumentStaticData_BlackListed, \r\n   " +
                                                                                                            "                 T_0.HardToBorrow AS DBInstrumentStaticData_HardToBorrow, \r\n    " +
                                                                                                            "                T_0.Restricted AS DBInstrumentStaticData_Restricted, \r\n         " +
                                                                                                            "           T_0.MaxNominalTrade AS DBInstrumentStaticData_MaxNominalTrade, \r\n    " +
                                                                                                            "                T_0.MaxNominalBook AS DBInstrumentStaticData_MaxNominalBook, \r\n " +
                                                                                                            "                   T_0.MaxVariationPercentage AS DBInstrumentStaticData_MaxVaria" +
                                                                                                            "tionPercentage, \r\n                    T_0.Currency2 AS DBInstrumentStaticData_Cu" +
                                                                                                            "rrency2, \r\n                    T_0.Sector AS DBInstrumentStaticData_Sector, \r\n  " +
                                                                                                            "                  T_0.Maturity AS DBInstrumentStaticData_Maturity, \r\n           " +
                                                                                                            "         T_0.Tenor AS DBInstrumentStaticData_Tenor, \r\n                    T_0.St" +
                                                                                                            "rike AS DBInstrumentStaticData_Strike, \r\n                    T_0.K AS DBInstrume" +
                                                                                                            "ntStaticData_K, \r\n                    T_0.K1 AS DBInstrumentStaticData_K1, \r\n   " +
                                                                                                            "                 T_0.K2 AS DBInstrumentStaticData_K2, \r\n                    T_0." +
                                                                                                            "T AS DBInstrumentStaticData_T, \r\n                    T_0.T1 AS DBInstrumentStati" +
                                                                                                            "cData_T1, \r\n                    T_0.T2 AS DBInstrumentStaticData_T2, \r\n         " +
                                                                                                            "           T_0.OptionType AS DBInstrumentStaticData_OptionType, \r\n              " +
                                                                                                            "      T_0.BarrierType AS DBInstrumentStaticData_BarrierType, \r\n                 " +
                                                                                                            "   T_0.ExerciseType AS DBInstrumentStaticData_ExerciseType, \r\n                  " +
                                                                                                            "  T_0.C_InsertionStamp AS [DBInstrumentStaticData._InsertionStamp], \r\n          " +
                                                                                                            "          T_0.C_UpdateStamp AS [DBInstrumentStaticData._UpdateStamp], \r\n        " +
                                                                                                            "            True AS _from0\r\n                FROM OpenTrader_ForgeEntities.DBInst" +
                                                                                                            "rumentStaticData AS T_0) AS T_0_1\r\n                INNER JOIN (\r\n               " +
                                                                                                            " SELECT \r\n                    Key(T_0.DBInstrumentStaticData).ID AS DBInstrument" +
                                                                                                            "StaticData_ID, \r\n                    Key(T_0.DBMarket).ID AS DBInstrumentStaticD" +
                                                                                                            "ata_DBMarketID, \r\n                    True AS _from1\r\n                FROM OpenT" +
                                                                                                            "rader_ForgeEntities.FK__DBInstrum__DBMar__7A672E12 AS T_0) AS T_0_2\r\n           " +
                                                                                                            "     ON T_0_1.DBInstrumentStaticData_ID = T_0_2.DBInstrumentStaticData_ID) AS T3" +
                                                                                                            "\r\n            LEFT OUTER JOIN (\r\n            SELECT \r\n                Key(T_0.DB" +
                                                                                                            "InstrumentStaticData1).ID AS DBInstrumentStaticData_ID, \r\n                Key(T_" +
                                                                                                            "0.DBInstrumentStaticData).ID AS DBInstrumentStaticData_DBUnderlying1ID, \r\n      " +
                                                                                                            "          True AS _from3\r\n            FROM OpenTrader_ForgeEntities.FK__DBInstru" +
                                                                                                            "m__DBUnd__4CA06362 AS T_0) AS T4\r\n            ON T3.DBInstrumentStaticData_ID = " +
                                                                                                            "T4.DBInstrumentStaticData_ID\r\n            LEFT OUTER JOIN (\r\n            SELECT " +
                                                                                                            "\r\n                Key(T_0.DBInstrumentStaticData1).ID AS DBInstrumentStaticData_" +
                                                                                                            "ID, \r\n                Key(T_0.DBInstrumentStaticData).ID AS DBInstrumentStaticDa" +
                                                                                                            "ta_DBUnderlying2ID, \r\n                True AS _from4\r\n            FROM OpenTrade" +
                                                                                                            "r_ForgeEntities.FK__DBInstrum__DBUnd__4D94879B AS T_0) AS T5\r\n            ON T3." +
                                                                                                            "DBInstrumentStaticData_ID = T5.DBInstrumentStaticData_ID\r\n            LEFT OUTER" +
                                                                                                            " JOIN (\r\n            SELECT \r\n                Key(T_0.DBInstrumentStaticData1).I" +
                                                                                                            "D AS DBInstrumentStaticData_ID, \r\n                Key(T_0.DBInstrumentStaticData" +
                                                                                                            ").ID AS DBInstrumentStaticData_DBUnderlyingID, \r\n                True AS _from2\r" +
                                                                                                            "\n            FROM OpenTrader_ForgeEntities.FK__DBInstrum__DBUnd__4BAC3F29 AS T_0" +
                                                                                                            ") AS T6\r\n            ON T3.DBInstrumentStaticData_ID = T6.DBInstrumentStaticData" +
                                                                                                            "_ID\r\n    ) AS T7");
                                                                                                }
                                                                                                else
                                                                                                {
                                                                                                    if ((index == 22))
                                                                                                    {
                                                                                                        // return view for OpenTrader_ForgeModelStoreContainer.DBMarket
                                                                                                        return
                                                                                                            new KeyValuePair<string, string>(
                                                                                                                "OpenTrader_ForgeModelStoreContainer.DBMarket", 
                                                                                                                "\r\n    SELECT VALUE -- Constructing DBMarket\r\n        [OpenTrader_ForgeModel.Store" +
                                                                                                                "].DBMarket(T3.DBMarket_ID, T3.DBMarket_DBDictionaryID, T3.DBMarket_Name, T3.DBMa" +
                                                                                                                "rket_PreOpeningStart, T3.DBMarket_PreOpeningStop, T3.DBMarket_OpeningStart, T3.D" +
                                                                                                                "BMarket_OpeningStop, T3.DBMarket_ContinuousTradingStart, T3.DBMarket_ContinuousT" +
                                                                                                                "radingStop, T3.DBMarket_IntradayAuctionStart, T3.DBMarket_IntradayAuctionStop, T" +
                                                                                                                "3.DBMarket_PreClosingStart, T3.DBMarket_PreClosingStop, T3.DBMarket_ClosingStart" +
                                                                                                                ", T3.DBMarket_ClosingStop, T3.[DBMarket._InsertionStamp], T3.[DBMarket._UpdateSt" +
                                                                                                                "amp])\r\n    FROM (\r\n        SELECT T_0_1.DBMarket_ID, T_0_1.DBMarket_DBDictionary" +
                                                                                                                "ID, T_0_2.DBMarket_Name, T_0_2.DBMarket_PreOpeningStart, T_0_2.DBMarket_PreOpeni" +
                                                                                                                "ngStop, T_0_2.DBMarket_OpeningStart, T_0_2.DBMarket_OpeningStop, T_0_2.DBMarket_" +
                                                                                                                "ContinuousTradingStart, T_0_2.DBMarket_ContinuousTradingStop, T_0_2.DBMarket_Int" +
                                                                                                                "radayAuctionStart, T_0_2.DBMarket_IntradayAuctionStop, T_0_2.DBMarket_PreClosing" +
                                                                                                                "Start, T_0_2.DBMarket_PreClosingStop, T_0_2.DBMarket_ClosingStart, T_0_2.DBMarke" +
                                                                                                                "t_ClosingStop, T_0_2.[DBMarket._InsertionStamp], T_0_2.[DBMarket._UpdateStamp], " +
                                                                                                                "T_0_2._from0, T_0_1._from1\r\n        FROM  (\r\n            SELECT \r\n              " +
                                                                                                                "  Key(T_0.DBMarket).ID AS DBMarket_ID, \r\n                Key(T_0.DBDictionary).I" +
                                                                                                                "D AS DBMarket_DBDictionaryID, \r\n                True AS _from1\r\n            FROM" +
                                                                                                                " OpenTrader_ForgeEntities.FK__DBMarket__DBDict__797309D9 AS T_0) AS T_0_1\r\n     " +
                                                                                                                "       INNER JOIN (\r\n            SELECT \r\n                T_0.ID AS DBMarket_ID," +
                                                                                                                " \r\n                T_0.Name AS DBMarket_Name, \r\n                T_0.PreOpeningSt" +
                                                                                                                "art AS DBMarket_PreOpeningStart, \r\n                T_0.PreOpeningStop AS DBMarke" +
                                                                                                                "t_PreOpeningStop, \r\n                T_0.OpeningStart AS DBMarket_OpeningStart, \r" +
                                                                                                                "\n                T_0.OpeningStop AS DBMarket_OpeningStop, \r\n                T_0." +
                                                                                                                "ContinuousTradingStart AS DBMarket_ContinuousTradingStart, \r\n                T_0" +
                                                                                                                ".ContinuousTradingStop AS DBMarket_ContinuousTradingStop, \r\n                T_0." +
                                                                                                                "IntradayAuctionStart AS DBMarket_IntradayAuctionStart, \r\n                T_0.Int" +
                                                                                                                "radayAuctionStop AS DBMarket_IntradayAuctionStop, \r\n                T_0.PreClosi" +
                                                                                                                "ngStart AS DBMarket_PreClosingStart, \r\n                T_0.PreClosingStop AS DBM" +
                                                                                                                "arket_PreClosingStop, \r\n                T_0.ClosingStart AS DBMarket_ClosingStar" +
                                                                                                                "t, \r\n                T_0.ClosingStop AS DBMarket_ClosingStop, \r\n                " +
                                                                                                                "T_0.C_InsertionStamp AS [DBMarket._InsertionStamp], \r\n                T_0.C_Upda" +
                                                                                                                "teStamp AS [DBMarket._UpdateStamp], \r\n                True AS _from0\r\n          " +
                                                                                                                "  FROM OpenTrader_ForgeEntities.DBMarket AS T_0) AS T_0_2\r\n            ON T_0_1." +
                                                                                                                "DBMarket_ID = T_0_2.DBMarket_ID\r\n    ) AS T3");
                                                                                                    }
                                                                                                    else
                                                                                                    {
                                                                                                        if ((index == 23))
                                                                                                        {
                                                                                                            // return view for OpenTrader_ForgeModelStoreContainer.DBTickSizeRule
                                                                                                            return
                                                                                                                new KeyValuePair<string, string>(
                                                                                                                    "OpenTrader_ForgeModelStoreContainer.DBTickSizeRule", 
                                                                                                                    @"
    SELECT VALUE -- Constructing DBTickSizeRule
        [OpenTrader_ForgeModel.Store].DBTickSizeRule(T3.DBTickSizeRule_ID, T3.DBTickSizeRule_DBDictionaryID, T3.DBTickSizeRule_Name, T3.[DBTickSizeRule._InsertionStamp], T3.[DBTickSizeRule._UpdateStamp])
    FROM (
        SELECT T_0_1.DBTickSizeRule_ID, T_0_2.DBTickSizeRule_DBDictionaryID, T_0_1.DBTickSizeRule_Name, T_0_1.[DBTickSizeRule._InsertionStamp], T_0_1.[DBTickSizeRule._UpdateStamp], T_0_1._from0, (T_0_2._from1 AND T_0_2._from1 IS NOT NULL) AS _from1
        FROM  (
            SELECT 
                T_0.ID AS DBTickSizeRule_ID, 
                T_0.Name AS DBTickSizeRule_Name, 
                T_0.C_InsertionStamp AS [DBTickSizeRule._InsertionStamp], 
                T_0.C_UpdateStamp AS [DBTickSizeRule._UpdateStamp], 
                True AS _from0
            FROM OpenTrader_ForgeEntities.DBTickSizeRule AS T_0) AS T_0_1
            LEFT OUTER JOIN (
            SELECT 
                Key(T_0.DBTickSizeRule).ID AS DBTickSizeRule_ID, 
                Key(T_0.DBDictionary).ID AS DBTickSizeRule_DBDictionaryID, 
                True AS _from1
            FROM OpenTrader_ForgeEntities.FK__DBTickSiz__DBDic__4F7CD00D AS T_0) AS T_0_2
            ON T_0_1.DBTickSizeRule_ID = T_0_2.DBTickSizeRule_ID
    ) AS T3");
                                                                                                        }
                                                                                                        else
                                                                                                        {
                                                                                                            if ((index == 24))
                                                                                                            {
                                                                                                                // return view for OpenTrader_ForgeModelStoreContainer.DBTickSizeRuleField
                                                                                                                return
                                                                                                                    new KeyValuePair<string, string>(
                                                                                                                        "OpenTrader_ForgeModelStoreContainer.DBTickSizeRuleField", 
                                                                                                                        "\r\n    SELECT VALUE -- Constructing DBTickSizeRuleField\r\n        [OpenTrader_Forge" +
                                                                                                                        "Model.Store].DBTickSizeRuleField(T3.DBTickSizeRuleField_ID, T3.DBTickSizeRuleFie" +
                                                                                                                        "ld_DBTickSizeRuleFieldID, T3.DBTickSizeRuleField_Price, T3.DBTickSizeRuleField_T" +
                                                                                                                        "ickSize, T3.[DBTickSizeRuleField._InsertionStamp], T3.[DBTickSizeRuleField._Upda" +
                                                                                                                        "teStamp])\r\n    FROM (\r\n        SELECT T_0_1.DBTickSizeRuleField_ID, T_0_1.DBTick" +
                                                                                                                        "SizeRuleField_DBTickSizeRuleFieldID, T_0_2.DBTickSizeRuleField_Price, T_0_2.DBTi" +
                                                                                                                        "ckSizeRuleField_TickSize, T_0_2.[DBTickSizeRuleField._InsertionStamp], T_0_2.[DB" +
                                                                                                                        "TickSizeRuleField._UpdateStamp], T_0_2._from0, T_0_1._from1\r\n        FROM  (\r\n  " +
                                                                                                                        "          SELECT \r\n                Key(T_0.DBTickSizeRuleField).ID AS DBTickSize" +
                                                                                                                        "RuleField_ID, \r\n                Key(T_0.DBTickSizeRule).ID AS DBTickSizeRuleFiel" +
                                                                                                                        "d_DBTickSizeRuleFieldID, \r\n                True AS _from1\r\n            FROM Open" +
                                                                                                                        "Trader_ForgeEntities.FK__DBTickSiz__DBTic__5070F446 AS T_0) AS T_0_1\r\n          " +
                                                                                                                        "  INNER JOIN (\r\n            SELECT \r\n                T_0.ID AS DBTickSizeRuleFie" +
                                                                                                                        "ld_ID, \r\n                T_0.Price AS DBTickSizeRuleField_Price, \r\n             " +
                                                                                                                        "   T_0.TickSize AS DBTickSizeRuleField_TickSize, \r\n                T_0.C_Inserti" +
                                                                                                                        "onStamp AS [DBTickSizeRuleField._InsertionStamp], \r\n                T_0.C_Update" +
                                                                                                                        "Stamp AS [DBTickSizeRuleField._UpdateStamp], \r\n                True AS _from0\r\n " +
                                                                                                                        "           FROM OpenTrader_ForgeEntities.DBTickSizeRuleField AS T_0) AS T_0_2\r\n " +
                                                                                                                        "           ON T_0_1.DBTickSizeRuleField_ID = T_0_2.DBTickSizeRuleField_ID\r\n    )" +
                                                                                                                        " AS T3");
                                                                                                            }
                                                                                                            else
                                                                                                            {
                                                                                                                if ((index == 25))
                                                                                                                {
                                                                                                                    // return view for OpenTrader_ForgeEntities.DBCurrencyPrice
                                                                                                                    return
                                                                                                                        new KeyValuePair<string, string>(
                                                                                                                            "OpenTrader_ForgeEntities.DBCurrencyPrice", 
                                                                                                                            @"
    SELECT VALUE -- Constructing DBCurrencyPrice
        OpenTrader_ForgeModel.DBCurrencyPrice(T_0_1.DBCurrencyPrice_ID, T_0_1.DBCurrencyPrice_ForeignCurrency, T_0_1.DBCurrencyPrice_CurrencyPrice, T_0_1.[DBCurrencyPrice.C_InsertionStamp], T_0_1.[DBCurrencyPrice.C_UpdateStamp]) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_ForgeEntities.DBDictionary, ROW(T_0_1.[FK__DBCurrenc__DBDic__49C3F6B7.DBDictionary.ID]),OpenTrader_ForgeModel.DBDictionary),OpenTrader_ForgeModel.FK__DBCurrenc__DBDic__49C3F6B7,DBCurrencyPrice,DBDictionary) 
    FROM (
        SELECT 
            T_0.ID AS DBCurrencyPrice_ID, 
            T_0.ForeignCurrency AS DBCurrencyPrice_ForeignCurrency, 
            T_0.CurrencyPrice AS DBCurrencyPrice_CurrencyPrice, 
            T_0._InsertionStamp AS [DBCurrencyPrice.C_InsertionStamp], 
            T_0._UpdateStamp AS [DBCurrencyPrice.C_UpdateStamp], 
            True AS _from0, 
            T_0.DBDictionaryID AS [FK__DBCurrenc__DBDic__49C3F6B7.DBDictionary.ID]
        FROM OpenTrader_ForgeModelStoreContainer.DBCurrencyPrice AS T_0
    ) AS T_0_1");
                                                                                                                }
                                                                                                                else
                                                                                                                {
                                                                                                                    if ((index == 26))
                                                                                                                    {
                                                                                                                        // return view for OpenTrader_ForgeEntities.DBDictionary
                                                                                                                        return
                                                                                                                            new KeyValuePair<string, string>(
                                                                                                                                "OpenTrader_ForgeEntities.DBDictionary", 
                                                                                                                                @"
    SELECT VALUE -- Constructing DBDictionary
        OpenTrader_ForgeModel.DBDictionary(T_0_1.DBDictionary_ID, T_0_1.DBDictionary_DomesticCurrency)
    FROM (
        SELECT 
            T_0.ID AS DBDictionary_ID, 
            T_0.DomesticCurrency AS DBDictionary_DomesticCurrency, 
            True AS _from0
        FROM OpenTrader_ForgeModelStoreContainer.DBDictionary AS T_0
    ) AS T_0_1");
                                                                                                                    }
                                                                                                                    else
                                                                                                                    {
                                                                                                                        if ((index == 27))
                                                                                                                        {
                                                                                                                            // return view for OpenTrader_ForgeEntities.DBInstrumentStaticData
                                                                                                                            return
                                                                                                                                new KeyValuePair<string, string>
                                                                                                                                    (
                                                                                                                                    "OpenTrader_ForgeEntities.DBInstrumentStaticData", 
                                                                                                                                    "\r\n    SELECT VALUE -- Constructing DBInstrumentStaticData\r\n        OpenTrader_For" +
                                                                                                                                    "geModel.DBInstrumentStaticData(T_0_1.DBInstrumentStaticData_ID, T_0_1.DBInstrume" +
                                                                                                                                    "ntStaticData_Type, T_0_1.DBInstrumentStaticData_Name, T_0_1.DBInstrumentStaticDa" +
                                                                                                                                    "ta_Code, T_0_1.DBInstrumentStaticData_ISIN, T_0_1.DBInstrumentStaticData_Trading" +
                                                                                                                                    "Scope, T_0_1.DBInstrumentStaticData_Currency, T_0_1.DBInstrumentStaticData_DBTic" +
                                                                                                                                    "kSizeRuleID, T_0_1.DBInstrumentStaticData_DBFeedPluginID, T_0_1.DBInstrumentStat" +
                                                                                                                                    "icData_DBFeedPluginInstrumentStaticDataConfigurationID, T_0_1.DBInstrumentStatic" +
                                                                                                                                    "Data_DBOrderPluginID, T_0_1.DBInstrumentStaticData_DBOrderPluginInstrumentStatic" +
                                                                                                                                    "DataConfigurationID, T_0_1.DBInstrumentStaticData_PointValue, T_0_1.DBInstrument" +
                                                                                                                                    "StaticData_LotSize, T_0_1.DBInstrumentStaticData_Enabled, T_0_1.DBInstrumentStat" +
                                                                                                                                    "icData_BuyEnabled, T_0_1.DBInstrumentStaticData_SellEnabled, T_0_1.DBInstrumentS" +
                                                                                                                                    "taticData_ShortSellEnabled, T_0_1.DBInstrumentStaticData_BlackListed, T_0_1.DBIn" +
                                                                                                                                    "strumentStaticData_HardToBorrow, T_0_1.DBInstrumentStaticData_Restricted, T_0_1." +
                                                                                                                                    "DBInstrumentStaticData_MaxNominalTrade, T_0_1.DBInstrumentStaticData_MaxNominalB" +
                                                                                                                                    "ook, T_0_1.DBInstrumentStaticData_MaxVariationPercentage, T_0_1.DBInstrumentStat" +
                                                                                                                                    "icData_Currency2, T_0_1.DBInstrumentStaticData_Sector, T_0_1.DBInstrumentStaticD" +
                                                                                                                                    "ata_Maturity, T_0_1.DBInstrumentStaticData_Tenor, T_0_1.DBInstrumentStaticData_S" +
                                                                                                                                    "trike, T_0_1.DBInstrumentStaticData_K, T_0_1.DBInstrumentStaticData_K1, T_0_1.DB" +
                                                                                                                                    "InstrumentStaticData_K2, T_0_1.DBInstrumentStaticData_T, T_0_1.DBInstrumentStati" +
                                                                                                                                    "cData_T1, T_0_1.DBInstrumentStaticData_T2, T_0_1.DBInstrumentStaticData_OptionTy" +
                                                                                                                                    "pe, T_0_1.DBInstrumentStaticData_BarrierType, T_0_1.DBInstrumentStaticData_Exerc" +
                                                                                                                                    "iseType, T_0_1.[DBInstrumentStaticData.C_InsertionStamp], T_0_1.[DBInstrumentSta" +
                                                                                                                                    "ticData.C_UpdateStamp]) WITH \r\n        RELATIONSHIP(CREATEREF(OpenTrader_ForgeEn" +
                                                                                                                                    "tities.DBMarket, ROW(T_0_1.[FK__DBInstrum__DBMar__7A672E12.DBMarket.ID]),OpenTra" +
                                                                                                                                    "der_ForgeModel.DBMarket),OpenTrader_ForgeModel.FK__DBInstrum__DBMar__7A672E12,DB" +
                                                                                                                                    "InstrumentStaticData,DBMarket) \r\n        RELATIONSHIP(CREATEREF(OpenTrader_Forge" +
                                                                                                                                    "Entities.DBInstrumentStaticData, ROW(T_0_1.[FK__DBInstrum__DBUnd__4BAC3F29.DBIns" +
                                                                                                                                    "trumentStaticData.ID]),OpenTrader_ForgeModel.DBInstrumentStaticData),OpenTrader_" +
                                                                                                                                    "ForgeModel.FK__DBInstrum__DBUnd__4BAC3F29,DBInstrumentStaticData1,DBInstrumentSt" +
                                                                                                                                    "aticData) \r\n        RELATIONSHIP(CREATEREF(OpenTrader_ForgeEntities.DBInstrument" +
                                                                                                                                    "StaticData, ROW(T_0_1.[FK__DBInstrum__DBUnd__4CA06362.DBInstrumentStaticData.ID]" +
                                                                                                                                    "),OpenTrader_ForgeModel.DBInstrumentStaticData),OpenTrader_ForgeModel.FK__DBInst" +
                                                                                                                                    "rum__DBUnd__4CA06362,DBInstrumentStaticData1,DBInstrumentStaticData) \r\n        R" +
                                                                                                                                    "ELATIONSHIP(CREATEREF(OpenTrader_ForgeEntities.DBInstrumentStaticData, ROW(T_0_1" +
                                                                                                                                    ".[FK__DBInstrum__DBUnd__4D94879B.DBInstrumentStaticData.ID]),OpenTrader_ForgeMod" +
                                                                                                                                    "el.DBInstrumentStaticData),OpenTrader_ForgeModel.FK__DBInstrum__DBUnd__4D94879B," +
                                                                                                                                    "DBInstrumentStaticData1,DBInstrumentStaticData) \r\n    FROM (\r\n        SELECT \r\n " +
                                                                                                                                    "           T_0.ID AS DBInstrumentStaticData_ID, \r\n            T_0.Type AS DBInst" +
                                                                                                                                    "rumentStaticData_Type, \r\n            T_0.Name AS DBInstrumentStaticData_Name, \r\n" +
                                                                                                                                    "            T_0.Code AS DBInstrumentStaticData_Code, \r\n            T_0.ISIN AS D" +
                                                                                                                                    "BInstrumentStaticData_ISIN, \r\n            T_0.TradingScope AS DBInstrumentStatic" +
                                                                                                                                    "Data_TradingScope, \r\n            T_0.Currency AS DBInstrumentStaticData_Currency" +
                                                                                                                                    ", \r\n            T_0.DBTickSizeRuleID AS DBInstrumentStaticData_DBTickSizeRuleID," +
                                                                                                                                    " \r\n            T_0.DBFeedPluginID AS DBInstrumentStaticData_DBFeedPluginID, \r\n  " +
                                                                                                                                    "          T_0.DBFeedPluginInstrumentStaticDataConfigurationID AS DBInstrumentSta" +
                                                                                                                                    "ticData_DBFeedPluginInstrumentStaticDataConfigurationID, \r\n            T_0.DBOrd" +
                                                                                                                                    "erPluginID AS DBInstrumentStaticData_DBOrderPluginID, \r\n            T_0.DBOrderP" +
                                                                                                                                    "luginInstrumentStaticDataConfigurationID AS DBInstrumentStaticData_DBOrderPlugin" +
                                                                                                                                    "InstrumentStaticDataConfigurationID, \r\n            T_0.PointValue AS DBInstrumen" +
                                                                                                                                    "tStaticData_PointValue, \r\n            T_0.LotSize AS DBInstrumentStaticData_LotS" +
                                                                                                                                    "ize, \r\n            T_0.Enabled AS DBInstrumentStaticData_Enabled, \r\n            " +
                                                                                                                                    "T_0.BuyEnabled AS DBInstrumentStaticData_BuyEnabled, \r\n            T_0.SellEnabl" +
                                                                                                                                    "ed AS DBInstrumentStaticData_SellEnabled, \r\n            T_0.ShortSellEnabled AS " +
                                                                                                                                    "DBInstrumentStaticData_ShortSellEnabled, \r\n            T_0.BlackListed AS DBInst" +
                                                                                                                                    "rumentStaticData_BlackListed, \r\n            T_0.HardToBorrow AS DBInstrumentStat" +
                                                                                                                                    "icData_HardToBorrow, \r\n            T_0.Restricted AS DBInstrumentStaticData_Rest" +
                                                                                                                                    "ricted, \r\n            T_0.MaxNominalTrade AS DBInstrumentStaticData_MaxNominalTr" +
                                                                                                                                    "ade, \r\n            T_0.MaxNominalBook AS DBInstrumentStaticData_MaxNominalBook, " +
                                                                                                                                    "\r\n            T_0.MaxVariationPercentage AS DBInstrumentStaticData_MaxVariationP" +
                                                                                                                                    "ercentage, \r\n            T_0.Currency2 AS DBInstrumentStaticData_Currency2, \r\n  " +
                                                                                                                                    "          T_0.Sector AS DBInstrumentStaticData_Sector, \r\n            T_0.Maturit" +
                                                                                                                                    "y AS DBInstrumentStaticData_Maturity, \r\n            T_0.Tenor AS DBInstrumentSta" +
                                                                                                                                    "ticData_Tenor, \r\n            T_0.Strike AS DBInstrumentStaticData_Strike, \r\n    " +
                                                                                                                                    "        T_0.K AS DBInstrumentStaticData_K, \r\n            T_0.K1 AS DBInstrumentS" +
                                                                                                                                    "taticData_K1, \r\n            T_0.K2 AS DBInstrumentStaticData_K2, \r\n            T" +
                                                                                                                                    "_0.T AS DBInstrumentStaticData_T, \r\n            T_0.T1 AS DBInstrumentStaticData" +
                                                                                                                                    "_T1, \r\n            T_0.T2 AS DBInstrumentStaticData_T2, \r\n            T_0.Option" +
                                                                                                                                    "Type AS DBInstrumentStaticData_OptionType, \r\n            T_0.BarrierType AS DBIn" +
                                                                                                                                    "strumentStaticData_BarrierType, \r\n            T_0.ExerciseType AS DBInstrumentSt" +
                                                                                                                                    "aticData_ExerciseType, \r\n            T_0._InsertionStamp AS [DBInstrumentStaticD" +
                                                                                                                                    "ata.C_InsertionStamp], \r\n            T_0._UpdateStamp AS [DBInstrumentStaticData" +
                                                                                                                                    ".C_UpdateStamp], \r\n            True AS _from0, \r\n            T_0.DBMarketID AS [" +
                                                                                                                                    "FK__DBInstrum__DBMar__7A672E12.DBMarket.ID], \r\n            T_0.DBUnderlyingID AS" +
                                                                                                                                    " [FK__DBInstrum__DBUnd__4BAC3F29.DBInstrumentStaticData.ID], \r\n            T_0.D" +
                                                                                                                                    "BUnderlying1ID AS [FK__DBInstrum__DBUnd__4CA06362.DBInstrumentStaticData.ID], \r\n" +
                                                                                                                                    "            T_0.DBUnderlying2ID AS [FK__DBInstrum__DBUnd__4D94879B.DBInstrumentS" +
                                                                                                                                    "taticData.ID]\r\n        FROM OpenTrader_ForgeModelStoreContainer.DBInstrumentStat" +
                                                                                                                                    "icData AS T_0\r\n    ) AS T_0_1");
                                                                                                                        }
                                                                                                                        else
                                                                                                                        {
                                                                                                                            if ((index == 28))
                                                                                                                            {
                                                                                                                                // return view for OpenTrader_ForgeEntities.DBMarket
                                                                                                                                return
                                                                                                                                    new KeyValuePair
                                                                                                                                        <string, string>(
                                                                                                                                        "OpenTrader_ForgeEntities.DBMarket", 
                                                                                                                                        "\r\n    SELECT VALUE -- Constructing DBMarket\r\n        OpenTrader_ForgeModel.DBMark" +
                                                                                                                                        "et(T_0_1.DBMarket_ID, T_0_1.DBMarket_Name, T_0_1.DBMarket_PreOpeningStart, T_0_1" +
                                                                                                                                        ".DBMarket_PreOpeningStop, T_0_1.DBMarket_OpeningStart, T_0_1.DBMarket_OpeningSto" +
                                                                                                                                        "p, T_0_1.DBMarket_ContinuousTradingStart, T_0_1.DBMarket_ContinuousTradingStop, " +
                                                                                                                                        "T_0_1.DBMarket_IntradayAuctionStart, T_0_1.DBMarket_IntradayAuctionStop, T_0_1.D" +
                                                                                                                                        "BMarket_PreClosingStart, T_0_1.DBMarket_PreClosingStop, T_0_1.DBMarket_ClosingSt" +
                                                                                                                                        "art, T_0_1.DBMarket_ClosingStop, T_0_1.[DBMarket.C_InsertionStamp], T_0_1.[DBMar" +
                                                                                                                                        "ket.C_UpdateStamp]) WITH \r\n        RELATIONSHIP(CREATEREF(OpenTrader_ForgeEntiti" +
                                                                                                                                        "es.DBDictionary, ROW(T_0_1.[FK__DBMarket__DBDict__797309D9.DBDictionary.ID]),Ope" +
                                                                                                                                        "nTrader_ForgeModel.DBDictionary),OpenTrader_ForgeModel.FK__DBMarket__DBDict__797" +
                                                                                                                                        "309D9,DBMarket,DBDictionary) \r\n    FROM (\r\n        SELECT \r\n            T_0.ID A" +
                                                                                                                                        "S DBMarket_ID, \r\n            T_0.Name AS DBMarket_Name, \r\n            T_0.PreOpe" +
                                                                                                                                        "ningStart AS DBMarket_PreOpeningStart, \r\n            T_0.PreOpeningStop AS DBMar" +
                                                                                                                                        "ket_PreOpeningStop, \r\n            T_0.OpeningStart AS DBMarket_OpeningStart, \r\n " +
                                                                                                                                        "           T_0.OpeningStop AS DBMarket_OpeningStop, \r\n            T_0.Continuous" +
                                                                                                                                        "TradingStart AS DBMarket_ContinuousTradingStart, \r\n            T_0.ContinuousTra" +
                                                                                                                                        "dingStop AS DBMarket_ContinuousTradingStop, \r\n            T_0.IntradayAuctionSta" +
                                                                                                                                        "rt AS DBMarket_IntradayAuctionStart, \r\n            T_0.IntradayAuctionStop AS DB" +
                                                                                                                                        "Market_IntradayAuctionStop, \r\n            T_0.PreClosingStart AS DBMarket_PreClo" +
                                                                                                                                        "singStart, \r\n            T_0.PreClosingStop AS DBMarket_PreClosingStop, \r\n      " +
                                                                                                                                        "      T_0.ClosingStart AS DBMarket_ClosingStart, \r\n            T_0.ClosingStop A" +
                                                                                                                                        "S DBMarket_ClosingStop, \r\n            T_0._InsertionStamp AS [DBMarket.C_Inserti" +
                                                                                                                                        "onStamp], \r\n            T_0._UpdateStamp AS [DBMarket.C_UpdateStamp], \r\n        " +
                                                                                                                                        "    True AS _from0, \r\n            T_0.DBDictionaryID AS [FK__DBMarket__DBDict__7" +
                                                                                                                                        "97309D9.DBDictionary.ID]\r\n        FROM OpenTrader_ForgeModelStoreContainer.DBMar" +
                                                                                                                                        "ket AS T_0\r\n    ) AS T_0_1");
                                                                                                                            }
                                                                                                                            else
                                                                                                                            {
                                                                                                                                if ((index == 29))
                                                                                                                                {
                                                                                                                                    // return view for OpenTrader_ForgeEntities.DBTickSizeRule
                                                                                                                                    return
                                                                                                                                        new KeyValuePair
                                                                                                                                            <string, string>(
                                                                                                                                            "OpenTrader_ForgeEntities.DBTickSizeRule", 
                                                                                                                                            @"
    SELECT VALUE -- Constructing DBTickSizeRule
        OpenTrader_ForgeModel.DBTickSizeRule(T_0_1.DBTickSizeRule_ID, T_0_1.DBTickSizeRule_Name, T_0_1.[DBTickSizeRule.C_InsertionStamp], T_0_1.[DBTickSizeRule.C_UpdateStamp]) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_ForgeEntities.DBDictionary, ROW(T_0_1.[FK__DBTickSiz__DBDic__4F7CD00D.DBDictionary.ID]),OpenTrader_ForgeModel.DBDictionary),OpenTrader_ForgeModel.FK__DBTickSiz__DBDic__4F7CD00D,DBTickSizeRule,DBDictionary) 
    FROM (
        SELECT 
            T_0.ID AS DBTickSizeRule_ID, 
            T_0.Name AS DBTickSizeRule_Name, 
            T_0._InsertionStamp AS [DBTickSizeRule.C_InsertionStamp], 
            T_0._UpdateStamp AS [DBTickSizeRule.C_UpdateStamp], 
            True AS _from0, 
            T_0.DBDictionaryID AS [FK__DBTickSiz__DBDic__4F7CD00D.DBDictionary.ID]
        FROM OpenTrader_ForgeModelStoreContainer.DBTickSizeRule AS T_0
    ) AS T_0_1");
                                                                                                                                }
                                                                                                                                else
                                                                                                                                {
                                                                                                                                    if ((index == 30))
                                                                                                                                    {
                                                                                                                                        // return view for OpenTrader_ForgeEntities.DBTickSizeRuleField
                                                                                                                                        return
                                                                                                                                            new KeyValuePair
                                                                                                                                                <string, string>
                                                                                                                                                (
                                                                                                                                                "OpenTrader_ForgeEntities.DBTickSizeRuleField", 
                                                                                                                                                @"
    SELECT VALUE -- Constructing DBTickSizeRuleField
        OpenTrader_ForgeModel.DBTickSizeRuleField(T_0_1.DBTickSizeRuleField_ID, T_0_1.DBTickSizeRuleField_Price, T_0_1.DBTickSizeRuleField_TickSize, T_0_1.[DBTickSizeRuleField.C_InsertionStamp], T_0_1.[DBTickSizeRuleField.C_UpdateStamp]) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_ForgeEntities.DBTickSizeRule, ROW(T_0_1.[FK__DBTickSiz__DBTic__5070F446.DBTickSizeRule.ID]),OpenTrader_ForgeModel.DBTickSizeRule),OpenTrader_ForgeModel.FK__DBTickSiz__DBTic__5070F446,DBTickSizeRuleField,DBTickSizeRule) 
    FROM (
        SELECT 
            T_0.ID AS DBTickSizeRuleField_ID, 
            T_0.Price AS DBTickSizeRuleField_Price, 
            T_0.TickSize AS DBTickSizeRuleField_TickSize, 
            T_0._InsertionStamp AS [DBTickSizeRuleField.C_InsertionStamp], 
            T_0._UpdateStamp AS [DBTickSizeRuleField.C_UpdateStamp], 
            True AS _from0, 
            T_0.DBTickSizeRuleFieldID AS [FK__DBTickSiz__DBTic__5070F446.DBTickSizeRule.ID]
        FROM OpenTrader_ForgeModelStoreContainer.DBTickSizeRuleField AS T_0
    ) AS T_0_1");
                                                                                                                                    }
                                                                                                                                    else
                                                                                                                                    {
                                                                                                                                        if ((index == 31))
                                                                                                                                        {
                                                                                                                                            // return view for OpenTrader_ForgeEntities.FK__DBCurrenc__DBDic__49C3F6B7
                                                                                                                                            return
                                                                                                                                                new KeyValuePair
                                                                                                                                                    <string, 
                                                                                                                                                        string>(
                                                                                                                                                    "OpenTrader_ForgeEntities.FK__DBCurrenc__DBDic__49C3F6B7", 
                                                                                                                                                    @"
    SELECT VALUE -- Constructing FK__DBCurrenc__DBDic__49C3F6B7
        OpenTrader_ForgeModel.FK__DBCurrenc__DBDic__49C3F6B7(T3.[FK__DBCurrenc__DBDic__49C3F6B7.DBDictionary], T3.[FK__DBCurrenc__DBDic__49C3F6B7.DBCurrencyPrice])
    FROM (
        SELECT -- Constructing DBDictionary
            CreateRef(OpenTrader_ForgeEntities.DBDictionary, row(T_0_2.[FK__DBCurrenc__DBDic__49C3F6B7.DBDictionary.ID]),OpenTrader_ForgeModel.DBDictionary) AS [FK__DBCurrenc__DBDic__49C3F6B7.DBDictionary], 
            T_0_2.[FK__DBCurrenc__DBDic__49C3F6B7.DBCurrencyPrice]
        FROM (
            SELECT -- Constructing DBCurrencyPrice
                CreateRef(OpenTrader_ForgeEntities.DBCurrencyPrice, row(T_0_1.[FK__DBCurrenc__DBDic__49C3F6B7.DBCurrencyPrice.ID]),OpenTrader_ForgeModel.DBCurrencyPrice) AS [FK__DBCurrenc__DBDic__49C3F6B7.DBCurrencyPrice], 
                T_0_1.[FK__DBCurrenc__DBDic__49C3F6B7.DBDictionary.ID]
            FROM (
                SELECT 
                    T_0.DBDictionaryID AS [FK__DBCurrenc__DBDic__49C3F6B7.DBDictionary.ID], 
                    T_0.ID AS [FK__DBCurrenc__DBDic__49C3F6B7.DBCurrencyPrice.ID], 
                    True AS _from0
                FROM OpenTrader_ForgeModelStoreContainer.DBCurrencyPrice AS T_0
            ) AS T_0_1
        ) AS T_0_2
    ) AS T3");
                                                                                                                                        }
                                                                                                                                        else
                                                                                                                                        {
                                                                                                                                            if ((index == 32))
                                                                                                                                            {
                                                                                                                                                // return view for OpenTrader_ForgeEntities.FK__DBMarket__DBDict__797309D9
                                                                                                                                                return
                                                                                                                                                    new KeyValuePair
                                                                                                                                                        <string, 
                                                                                                                                                            string
                                                                                                                                                            >(
                                                                                                                                                        "OpenTrader_ForgeEntities.FK__DBMarket__DBDict__797309D9", 
                                                                                                                                                        @"
    SELECT VALUE -- Constructing FK__DBMarket__DBDict__797309D9
        OpenTrader_ForgeModel.FK__DBMarket__DBDict__797309D9(T3.[FK__DBMarket__DBDict__797309D9.DBDictionary], T3.[FK__DBMarket__DBDict__797309D9.DBMarket])
    FROM (
        SELECT -- Constructing DBDictionary
            CreateRef(OpenTrader_ForgeEntities.DBDictionary, row(T_0_2.[FK__DBMarket__DBDict__797309D9.DBDictionary.ID]),OpenTrader_ForgeModel.DBDictionary) AS [FK__DBMarket__DBDict__797309D9.DBDictionary], 
            T_0_2.[FK__DBMarket__DBDict__797309D9.DBMarket]
        FROM (
            SELECT -- Constructing DBMarket
                CreateRef(OpenTrader_ForgeEntities.DBMarket, row(T_0_1.[FK__DBMarket__DBDict__797309D9.DBMarket.ID]),OpenTrader_ForgeModel.DBMarket) AS [FK__DBMarket__DBDict__797309D9.DBMarket], 
                T_0_1.[FK__DBMarket__DBDict__797309D9.DBDictionary.ID]
            FROM (
                SELECT 
                    T_0.DBDictionaryID AS [FK__DBMarket__DBDict__797309D9.DBDictionary.ID], 
                    T_0.ID AS [FK__DBMarket__DBDict__797309D9.DBMarket.ID], 
                    True AS _from0
                FROM OpenTrader_ForgeModelStoreContainer.DBMarket AS T_0
            ) AS T_0_1
        ) AS T_0_2
    ) AS T3");
                                                                                                                                            }
                                                                                                                                            else
                                                                                                                                            {
                                                                                                                                                if ((index == 33))
                                                                                                                                                {
                                                                                                                                                    // return view for OpenTrader_ForgeEntities.FK__DBTickSiz__DBDic__4F7CD00D
                                                                                                                                                    return
                                                                                                                                                        new KeyValuePair
                                                                                                                                                            <
                                                                                                                                                                string
                                                                                                                                                                , 
                                                                                                                                                                string
                                                                                                                                                                >
                                                                                                                                                            (
                                                                                                                                                            "OpenTrader_ForgeEntities.FK__DBTickSiz__DBDic__4F7CD00D", 
                                                                                                                                                            @"
    SELECT VALUE -- Constructing FK__DBTickSiz__DBDic__4F7CD00D
        OpenTrader_ForgeModel.FK__DBTickSiz__DBDic__4F7CD00D(T3.[FK__DBTickSiz__DBDic__4F7CD00D.DBDictionary], T3.[FK__DBTickSiz__DBDic__4F7CD00D.DBTickSizeRule])
    FROM (
        SELECT -- Constructing DBDictionary
            CreateRef(OpenTrader_ForgeEntities.DBDictionary, row(T_0_2.[FK__DBTickSiz__DBDic__4F7CD00D.DBDictionary.ID]),OpenTrader_ForgeModel.DBDictionary) AS [FK__DBTickSiz__DBDic__4F7CD00D.DBDictionary], 
            T_0_2.[FK__DBTickSiz__DBDic__4F7CD00D.DBTickSizeRule]
        FROM (
            SELECT -- Constructing DBTickSizeRule
                CreateRef(OpenTrader_ForgeEntities.DBTickSizeRule, row(T_0_1.[FK__DBTickSiz__DBDic__4F7CD00D.DBTickSizeRule.ID]),OpenTrader_ForgeModel.DBTickSizeRule) AS [FK__DBTickSiz__DBDic__4F7CD00D.DBTickSizeRule], 
                T_0_1.[FK__DBTickSiz__DBDic__4F7CD00D.DBDictionary.ID]
            FROM (
                SELECT 
                    T_0.DBDictionaryID AS [FK__DBTickSiz__DBDic__4F7CD00D.DBDictionary.ID], 
                    T_0.ID AS [FK__DBTickSiz__DBDic__4F7CD00D.DBTickSizeRule.ID], 
                    True AS _from0
                FROM OpenTrader_ForgeModelStoreContainer.DBTickSizeRule AS T_0
                WHERE T_0.DBDictionaryID IS NOT NULL
            ) AS T_0_1
        ) AS T_0_2
    ) AS T3");
                                                                                                                                                }
                                                                                                                                                else
                                                                                                                                                {
                                                                                                                                                    if (
                                                                                                                                                        (index ==
                                                                                                                                                         34))
                                                                                                                                                    {
                                                                                                                                                        // return view for OpenTrader_ForgeEntities.FK__DBInstrum__DBMar__7A672E12
                                                                                                                                                        return
                                                                                                                                                            new KeyValuePair
                                                                                                                                                                <
                                                                                                                                                                    string
                                                                                                                                                                    , 
                                                                                                                                                                    string
                                                                                                                                                                    >
                                                                                                                                                                (
                                                                                                                                                                "OpenTrader_ForgeEntities.FK__DBInstrum__DBMar__7A672E12", 
                                                                                                                                                                @"
    SELECT VALUE -- Constructing FK__DBInstrum__DBMar__7A672E12
        OpenTrader_ForgeModel.FK__DBInstrum__DBMar__7A672E12(T3.[FK__DBInstrum__DBMar__7A672E12.DBMarket], T3.[FK__DBInstrum__DBMar__7A672E12.DBInstrumentStaticData])
    FROM (
        SELECT -- Constructing DBMarket
            CreateRef(OpenTrader_ForgeEntities.DBMarket, row(T_0_2.[FK__DBInstrum__DBMar__7A672E12.DBMarket.ID]),OpenTrader_ForgeModel.DBMarket) AS [FK__DBInstrum__DBMar__7A672E12.DBMarket], 
            T_0_2.[FK__DBInstrum__DBMar__7A672E12.DBInstrumentStaticData]
        FROM (
            SELECT -- Constructing DBInstrumentStaticData
                CreateRef(OpenTrader_ForgeEntities.DBInstrumentStaticData, row(T_0_1.[FK__DBInstrum__DBMar__7A672E12.DBInstrumentStaticData.ID]),OpenTrader_ForgeModel.DBInstrumentStaticData) AS [FK__DBInstrum__DBMar__7A672E12.DBInstrumentStaticData], 
                T_0_1.[FK__DBInstrum__DBMar__7A672E12.DBMarket.ID]
            FROM (
                SELECT 
                    T_0.DBMarketID AS [FK__DBInstrum__DBMar__7A672E12.DBMarket.ID], 
                    T_0.ID AS [FK__DBInstrum__DBMar__7A672E12.DBInstrumentStaticData.ID], 
                    True AS _from0
                FROM OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticData AS T_0
            ) AS T_0_1
        ) AS T_0_2
    ) AS T3");
                                                                                                                                                    }
                                                                                                                                                    else
                                                                                                                                                    {
                                                                                                                                                        if (
                                                                                                                                                            (index ==
                                                                                                                                                             35))
                                                                                                                                                        {
                                                                                                                                                            // return view for OpenTrader_ForgeEntities.FK__DBInstrum__DBUnd__4BAC3F29
                                                                                                                                                            return
                                                                                                                                                                new KeyValuePair
                                                                                                                                                                    <
                                                                                                                                                                        string
                                                                                                                                                                        , 
                                                                                                                                                                        string
                                                                                                                                                                        >
                                                                                                                                                                    (
                                                                                                                                                                    "OpenTrader_ForgeEntities.FK__DBInstrum__DBUnd__4BAC3F29", 
                                                                                                                                                                    "\r\n    SELECT VALUE -- Constructing FK__DBInstrum__DBUnd__4BAC3F29\r\n        OpenTr" +
                                                                                                                                                                    "ader_ForgeModel.FK__DBInstrum__DBUnd__4BAC3F29(T3.[FK__DBInstrum__DBUnd__4BAC3F2" +
                                                                                                                                                                    "9.DBInstrumentStaticData], T3.[FK__DBInstrum__DBUnd__4BAC3F29.DBInstrumentStatic" +
                                                                                                                                                                    "Data1])\r\n    FROM (\r\n        SELECT -- Constructing DBInstrumentStaticData\r\n    " +
                                                                                                                                                                    "        CreateRef(OpenTrader_ForgeEntities.DBInstrumentStaticData, row(T_0_2.[FK" +
                                                                                                                                                                    "__DBInstrum__DBUnd__4BAC3F29.DBInstrumentStaticData.ID]),OpenTrader_ForgeModel.D" +
                                                                                                                                                                    "BInstrumentStaticData) AS [FK__DBInstrum__DBUnd__4BAC3F29.DBInstrumentStaticData" +
                                                                                                                                                                    "], \r\n            T_0_2.[FK__DBInstrum__DBUnd__4BAC3F29.DBInstrumentStaticData1]\r" +
                                                                                                                                                                    "\n        FROM (\r\n            SELECT -- Constructing DBInstrumentStaticData1\r\n   " +
                                                                                                                                                                    "             CreateRef(OpenTrader_ForgeEntities.DBInstrumentStaticData, row(T_0_" +
                                                                                                                                                                    "1.[FK__DBInstrum__DBUnd__4BAC3F29.DBInstrumentStaticData1.ID]),OpenTrader_ForgeM" +
                                                                                                                                                                    "odel.DBInstrumentStaticData) AS [FK__DBInstrum__DBUnd__4BAC3F29.DBInstrumentStat" +
                                                                                                                                                                    "icData1], \r\n                T_0_1.[FK__DBInstrum__DBUnd__4BAC3F29.DBInstrumentSt" +
                                                                                                                                                                    "aticData.ID]\r\n            FROM (\r\n                SELECT \r\n                    T" +
                                                                                                                                                                    "_0.DBUnderlyingID AS [FK__DBInstrum__DBUnd__4BAC3F29.DBInstrumentStaticData.ID]," +
                                                                                                                                                                    " \r\n                    T_0.ID AS [FK__DBInstrum__DBUnd__4BAC3F29.DBInstrumentSta" +
                                                                                                                                                                    "ticData1.ID], \r\n                    True AS _from0\r\n                FROM OpenTra" +
                                                                                                                                                                    "der_ForgeModelStoreContainer.DBInstrumentStaticData AS T_0\r\n                WHER" +
                                                                                                                                                                    "E T_0.DBUnderlyingID IS NOT NULL\r\n            ) AS T_0_1\r\n        ) AS T_0_2\r\n  " +
                                                                                                                                                                    "  ) AS T3");
                                                                                                                                                        }
                                                                                                                                                        else
                                                                                                                                                        {
                                                                                                                                                            if (
                                                                                                                                                                (index ==
                                                                                                                                                                 36))
                                                                                                                                                            {
                                                                                                                                                                // return view for OpenTrader_ForgeEntities.FK__DBInstrum__DBUnd__4CA06362
                                                                                                                                                                return
                                                                                                                                                                    new KeyValuePair
                                                                                                                                                                        <
                                                                                                                                                                            string
                                                                                                                                                                            , 
                                                                                                                                                                            string
                                                                                                                                                                            >
                                                                                                                                                                        (
                                                                                                                                                                        "OpenTrader_ForgeEntities.FK__DBInstrum__DBUnd__4CA06362", 
                                                                                                                                                                        "\r\n    SELECT VALUE -- Constructing FK__DBInstrum__DBUnd__4CA06362\r\n        OpenTr" +
                                                                                                                                                                        "ader_ForgeModel.FK__DBInstrum__DBUnd__4CA06362(T3.[FK__DBInstrum__DBUnd__4CA0636" +
                                                                                                                                                                        "2.DBInstrumentStaticData], T3.[FK__DBInstrum__DBUnd__4CA06362.DBInstrumentStatic" +
                                                                                                                                                                        "Data1])\r\n    FROM (\r\n        SELECT -- Constructing DBInstrumentStaticData\r\n    " +
                                                                                                                                                                        "        CreateRef(OpenTrader_ForgeEntities.DBInstrumentStaticData, row(T_0_2.[FK" +
                                                                                                                                                                        "__DBInstrum__DBUnd__4CA06362.DBInstrumentStaticData.ID]),OpenTrader_ForgeModel.D" +
                                                                                                                                                                        "BInstrumentStaticData) AS [FK__DBInstrum__DBUnd__4CA06362.DBInstrumentStaticData" +
                                                                                                                                                                        "], \r\n            T_0_2.[FK__DBInstrum__DBUnd__4CA06362.DBInstrumentStaticData1]\r" +
                                                                                                                                                                        "\n        FROM (\r\n            SELECT -- Constructing DBInstrumentStaticData1\r\n   " +
                                                                                                                                                                        "             CreateRef(OpenTrader_ForgeEntities.DBInstrumentStaticData, row(T_0_" +
                                                                                                                                                                        "1.[FK__DBInstrum__DBUnd__4CA06362.DBInstrumentStaticData1.ID]),OpenTrader_ForgeM" +
                                                                                                                                                                        "odel.DBInstrumentStaticData) AS [FK__DBInstrum__DBUnd__4CA06362.DBInstrumentStat" +
                                                                                                                                                                        "icData1], \r\n                T_0_1.[FK__DBInstrum__DBUnd__4CA06362.DBInstrumentSt" +
                                                                                                                                                                        "aticData.ID]\r\n            FROM (\r\n                SELECT \r\n                    T" +
                                                                                                                                                                        "_0.DBUnderlying1ID AS [FK__DBInstrum__DBUnd__4CA06362.DBInstrumentStaticData.ID]" +
                                                                                                                                                                        ", \r\n                    T_0.ID AS [FK__DBInstrum__DBUnd__4CA06362.DBInstrumentSt" +
                                                                                                                                                                        "aticData1.ID], \r\n                    True AS _from0\r\n                FROM OpenTr" +
                                                                                                                                                                        "ader_ForgeModelStoreContainer.DBInstrumentStaticData AS T_0\r\n                WHE" +
                                                                                                                                                                        "RE T_0.DBUnderlying1ID IS NOT NULL\r\n            ) AS T_0_1\r\n        ) AS T_0_2\r\n" +
                                                                                                                                                                        "    ) AS T3");
                                                                                                                                                            }
                                                                                                                                                            else
                                                                                                                                                            {
                                                                                                                                                                if
                                                                                                                                                                    (
                                                                                                                                                                    (index ==
                                                                                                                                                                     37))
                                                                                                                                                                {
                                                                                                                                                                    // return view for OpenTrader_ForgeEntities.FK__DBInstrum__DBUnd__4D94879B
                                                                                                                                                                    return
                                                                                                                                                                        new KeyValuePair
                                                                                                                                                                            <
                                                                                                                                                                                string
                                                                                                                                                                                , 
                                                                                                                                                                                string
                                                                                                                                                                                >
                                                                                                                                                                            (
                                                                                                                                                                            "OpenTrader_ForgeEntities.FK__DBInstrum__DBUnd__4D94879B", 
                                                                                                                                                                            "\r\n    SELECT VALUE -- Constructing FK__DBInstrum__DBUnd__4D94879B\r\n        OpenTr" +
                                                                                                                                                                            "ader_ForgeModel.FK__DBInstrum__DBUnd__4D94879B(T3.[FK__DBInstrum__DBUnd__4D94879" +
                                                                                                                                                                            "B.DBInstrumentStaticData], T3.[FK__DBInstrum__DBUnd__4D94879B.DBInstrumentStatic" +
                                                                                                                                                                            "Data1])\r\n    FROM (\r\n        SELECT -- Constructing DBInstrumentStaticData\r\n    " +
                                                                                                                                                                            "        CreateRef(OpenTrader_ForgeEntities.DBInstrumentStaticData, row(T_0_2.[FK" +
                                                                                                                                                                            "__DBInstrum__DBUnd__4D94879B.DBInstrumentStaticData.ID]),OpenTrader_ForgeModel.D" +
                                                                                                                                                                            "BInstrumentStaticData) AS [FK__DBInstrum__DBUnd__4D94879B.DBInstrumentStaticData" +
                                                                                                                                                                            "], \r\n            T_0_2.[FK__DBInstrum__DBUnd__4D94879B.DBInstrumentStaticData1]\r" +
                                                                                                                                                                            "\n        FROM (\r\n            SELECT -- Constructing DBInstrumentStaticData1\r\n   " +
                                                                                                                                                                            "             CreateRef(OpenTrader_ForgeEntities.DBInstrumentStaticData, row(T_0_" +
                                                                                                                                                                            "1.[FK__DBInstrum__DBUnd__4D94879B.DBInstrumentStaticData1.ID]),OpenTrader_ForgeM" +
                                                                                                                                                                            "odel.DBInstrumentStaticData) AS [FK__DBInstrum__DBUnd__4D94879B.DBInstrumentStat" +
                                                                                                                                                                            "icData1], \r\n                T_0_1.[FK__DBInstrum__DBUnd__4D94879B.DBInstrumentSt" +
                                                                                                                                                                            "aticData.ID]\r\n            FROM (\r\n                SELECT \r\n                    T" +
                                                                                                                                                                            "_0.DBUnderlying2ID AS [FK__DBInstrum__DBUnd__4D94879B.DBInstrumentStaticData.ID]" +
                                                                                                                                                                            ", \r\n                    T_0.ID AS [FK__DBInstrum__DBUnd__4D94879B.DBInstrumentSt" +
                                                                                                                                                                            "aticData1.ID], \r\n                    True AS _from0\r\n                FROM OpenTr" +
                                                                                                                                                                            "ader_ForgeModelStoreContainer.DBInstrumentStaticData AS T_0\r\n                WHE" +
                                                                                                                                                                            "RE T_0.DBUnderlying2ID IS NOT NULL\r\n            ) AS T_0_1\r\n        ) AS T_0_2\r\n" +
                                                                                                                                                                            "    ) AS T3");
                                                                                                                                                                }
                                                                                                                                                                else
                                                                                                                                                                {
                                                                                                                                                                    if
                                                                                                                                                                        (
                                                                                                                                                                        (index ==
                                                                                                                                                                         38))
                                                                                                                                                                    {
                                                                                                                                                                        // return view for OpenTrader_ForgeEntities.FK__DBTickSiz__DBTic__5070F446
                                                                                                                                                                        return
                                                                                                                                                                            new KeyValuePair
                                                                                                                                                                                <
                                                                                                                                                                                    string
                                                                                                                                                                                    , 
                                                                                                                                                                                    string
                                                                                                                                                                                    >
                                                                                                                                                                                (
                                                                                                                                                                                "OpenTrader_ForgeEntities.FK__DBTickSiz__DBTic__5070F446", 
                                                                                                                                                                                @"
    SELECT VALUE -- Constructing FK__DBTickSiz__DBTic__5070F446
        OpenTrader_ForgeModel.FK__DBTickSiz__DBTic__5070F446(T3.[FK__DBTickSiz__DBTic__5070F446.DBTickSizeRule], T3.[FK__DBTickSiz__DBTic__5070F446.DBTickSizeRuleField])
    FROM (
        SELECT -- Constructing DBTickSizeRule
            CreateRef(OpenTrader_ForgeEntities.DBTickSizeRule, row(T_0_2.[FK__DBTickSiz__DBTic__5070F446.DBTickSizeRule.ID]),OpenTrader_ForgeModel.DBTickSizeRule) AS [FK__DBTickSiz__DBTic__5070F446.DBTickSizeRule], 
            T_0_2.[FK__DBTickSiz__DBTic__5070F446.DBTickSizeRuleField]
        FROM (
            SELECT -- Constructing DBTickSizeRuleField
                CreateRef(OpenTrader_ForgeEntities.DBTickSizeRuleField, row(T_0_1.[FK__DBTickSiz__DBTic__5070F446.DBTickSizeRuleField.ID]),OpenTrader_ForgeModel.DBTickSizeRuleField) AS [FK__DBTickSiz__DBTic__5070F446.DBTickSizeRuleField], 
                T_0_1.[FK__DBTickSiz__DBTic__5070F446.DBTickSizeRule.ID]
            FROM (
                SELECT 
                    T_0.DBTickSizeRuleFieldID AS [FK__DBTickSiz__DBTic__5070F446.DBTickSizeRule.ID], 
                    T_0.ID AS [FK__DBTickSiz__DBTic__5070F446.DBTickSizeRuleField.ID], 
                    True AS _from0
                FROM OpenTrader_ForgeModelStoreContainer.DBTickSizeRuleField AS T_0
            ) AS T_0_1
        ) AS T_0_2
    ) AS T3");
                                                                                                                                                                    }
                                                                                                                                                                    else
                                                                                                                                                                    {
                                                                                                                                                                        if
                                                                                                                                                                            (
                                                                                                                                                                            (index ==
                                                                                                                                                                             39))
                                                                                                                                                                        {
                                                                                                                                                                            // return view for OpenTrader_ForgeModelStoreContainer.DBCorporateActionFreeStocks
                                                                                                                                                                            return
                                                                                                                                                                                new KeyValuePair
                                                                                                                                                                                    <
                                                                                                                                                                                        string
                                                                                                                                                                                        , 
                                                                                                                                                                                        string
                                                                                                                                                                                        >
                                                                                                                                                                                    (
                                                                                                                                                                                    "OpenTrader_ForgeModelStoreContainer.DBCorporateActionFreeStocks", 
                                                                                                                                                                                    @"
    SELECT VALUE -- Constructing DBCorporateActionFreeStocks
        [OpenTrader_ForgeModel.Store].DBCorporateActionFreeStocks(T_0_1.DBCorporateActionFreeStocks_ID, T_0_1.DBCorporateActionFreeStocks_Type, T_0_1.DBCorporateActionFreeStocks_DateCreation, T_0_1.DBCorporateActionFreeStocks_DateExercice, T_0_1.DBCorporateActionFreeStocks_Name, T_0_1.DBCorporateActionFreeStocks_DBInstrumentStaticDataID, T_0_1.DBCorporateActionFreeStocks_Enabled, T_0_1.DBCorporateActionFreeStocks_Quantity, T_0_1.DBCorporateActionFreeStocks_Price)
    FROM (
        SELECT 
            T_0.ID AS DBCorporateActionFreeStocks_ID, 
            T_0.Type AS DBCorporateActionFreeStocks_Type, 
            T_0.DateCreation AS DBCorporateActionFreeStocks_DateCreation, 
            T_0.DateExercice AS DBCorporateActionFreeStocks_DateExercice, 
            T_0.Name AS DBCorporateActionFreeStocks_Name, 
            T_0.DBInstrumentStaticDataID AS DBCorporateActionFreeStocks_DBInstrumentStaticDataID, 
            T_0.Enabled AS DBCorporateActionFreeStocks_Enabled, 
            T_0.Quantity AS DBCorporateActionFreeStocks_Quantity, 
            T_0.Price AS DBCorporateActionFreeStocks_Price, 
            True AS _from0
        FROM OpenTrader_ForgeEntities.DBCorporateActionFreeStocks AS T_0
    ) AS T_0_1");
                                                                                                                                                                        }
                                                                                                                                                                        else
                                                                                                                                                                        {
                                                                                                                                                                            if
                                                                                                                                                                                (
                                                                                                                                                                                (index ==
                                                                                                                                                                                 40))
                                                                                                                                                                            {
                                                                                                                                                                                // return view for OpenTrader_ForgeEntities.DBCorporateActionFreeStocks
                                                                                                                                                                                return
                                                                                                                                                                                    new KeyValuePair
                                                                                                                                                                                        <
                                                                                                                                                                                            string
                                                                                                                                                                                            , 
                                                                                                                                                                                            string
                                                                                                                                                                                            >
                                                                                                                                                                                        (
                                                                                                                                                                                        "OpenTrader_ForgeEntities.DBCorporateActionFreeStocks", 
                                                                                                                                                                                        @"
    SELECT VALUE -- Constructing DBCorporateActionFreeStocks
        OpenTrader_ForgeModel.DBCorporateActionFreeStocks(T_0_1.DBCorporateActionFreeStocks_ID, T_0_1.DBCorporateActionFreeStocks_Type, T_0_1.DBCorporateActionFreeStocks_DateCreation, T_0_1.DBCorporateActionFreeStocks_DateExercice, T_0_1.DBCorporateActionFreeStocks_Name, T_0_1.DBCorporateActionFreeStocks_DBInstrumentStaticDataID, T_0_1.DBCorporateActionFreeStocks_Enabled, T_0_1.DBCorporateActionFreeStocks_Quantity, T_0_1.DBCorporateActionFreeStocks_Price)
    FROM (
        SELECT 
            T_0.ID AS DBCorporateActionFreeStocks_ID, 
            T_0.Type AS DBCorporateActionFreeStocks_Type, 
            T_0.DateCreation AS DBCorporateActionFreeStocks_DateCreation, 
            T_0.DateExercice AS DBCorporateActionFreeStocks_DateExercice, 
            T_0.Name AS DBCorporateActionFreeStocks_Name, 
            T_0.DBInstrumentStaticDataID AS DBCorporateActionFreeStocks_DBInstrumentStaticDataID, 
            T_0.Enabled AS DBCorporateActionFreeStocks_Enabled, 
            T_0.Quantity AS DBCorporateActionFreeStocks_Quantity, 
            T_0.Price AS DBCorporateActionFreeStocks_Price, 
            True AS _from0
        FROM OpenTrader_ForgeModelStoreContainer.DBCorporateActionFreeStocks AS T_0
    ) AS T_0_1");
                                                                                                                                                                            }
                                                                                                                                                                            else
                                                                                                                                                                            {
                                                                                                                                                                                if
                                                                                                                                                                                    (
                                                                                                                                                                                    (index ==
                                                                                                                                                                                     41))
                                                                                                                                                                                {
                                                                                                                                                                                    // return view for OpenTrader_ForgeModelStoreContainer.DBCorporateActionSplit
                                                                                                                                                                                    return
                                                                                                                                                                                        new KeyValuePair
                                                                                                                                                                                            <
                                                                                                                                                                                                string
                                                                                                                                                                                                , 
                                                                                                                                                                                                string
                                                                                                                                                                                                >
                                                                                                                                                                                            (
                                                                                                                                                                                            "OpenTrader_ForgeModelStoreContainer.DBCorporateActionSplit", 
                                                                                                                                                                                            @"
    SELECT VALUE -- Constructing DBCorporateActionSplit
        [OpenTrader_ForgeModel.Store].DBCorporateActionSplit(T_0_1.DBCorporateActionSplit_ID, T_0_1.DBCorporateActionSplit_Type, T_0_1.DBCorporateActionSplit_DateCreation, T_0_1.DBCorporateActionSplit_DateExercice, T_0_1.DBCorporateActionSplit_Name, T_0_1.DBCorporateActionSplit_DBInstrumentStaticDataID, T_0_1.DBCorporateActionSplit_Enabled, T_0_1.DBCorporateActionSplit_Ratio)
    FROM (
        SELECT 
            T_0.ID AS DBCorporateActionSplit_ID, 
            T_0.Type AS DBCorporateActionSplit_Type, 
            T_0.DateCreation AS DBCorporateActionSplit_DateCreation, 
            T_0.DateExercice AS DBCorporateActionSplit_DateExercice, 
            T_0.Name AS DBCorporateActionSplit_Name, 
            T_0.DBInstrumentStaticDataID AS DBCorporateActionSplit_DBInstrumentStaticDataID, 
            T_0.Enabled AS DBCorporateActionSplit_Enabled, 
            T_0.Ratio AS DBCorporateActionSplit_Ratio, 
            True AS _from0
        FROM OpenTrader_ForgeEntities.DBCorporateActionSplit AS T_0
    ) AS T_0_1");
                                                                                                                                                                                }
                                                                                                                                                                                else
                                                                                                                                                                                {
                                                                                                                                                                                    if
                                                                                                                                                                                        (
                                                                                                                                                                                        (index ==
                                                                                                                                                                                         42))
                                                                                                                                                                                    {
                                                                                                                                                                                        // return view for OpenTrader_ForgeEntities.DBCorporateActionSplit
                                                                                                                                                                                        return
                                                                                                                                                                                            new KeyValuePair
                                                                                                                                                                                                <
                                                                                                                                                                                                    string
                                                                                                                                                                                                    , 
                                                                                                                                                                                                    string
                                                                                                                                                                                                    >
                                                                                                                                                                                                (
                                                                                                                                                                                                "OpenTrader_ForgeEntities.DBCorporateActionSplit", 
                                                                                                                                                                                                @"
    SELECT VALUE -- Constructing DBCorporateActionSplit
        OpenTrader_ForgeModel.DBCorporateActionSplit(T_0_1.DBCorporateActionSplit_ID, T_0_1.DBCorporateActionSplit_Type, T_0_1.DBCorporateActionSplit_DateCreation, T_0_1.DBCorporateActionSplit_DateExercice, T_0_1.DBCorporateActionSplit_Name, T_0_1.DBCorporateActionSplit_DBInstrumentStaticDataID, T_0_1.DBCorporateActionSplit_Enabled, T_0_1.DBCorporateActionSplit_Ratio)
    FROM (
        SELECT 
            T_0.ID AS DBCorporateActionSplit_ID, 
            T_0.Type AS DBCorporateActionSplit_Type, 
            T_0.DateCreation AS DBCorporateActionSplit_DateCreation, 
            T_0.DateExercice AS DBCorporateActionSplit_DateExercice, 
            T_0.Name AS DBCorporateActionSplit_Name, 
            T_0.DBInstrumentStaticDataID AS DBCorporateActionSplit_DBInstrumentStaticDataID, 
            T_0.Enabled AS DBCorporateActionSplit_Enabled, 
            T_0.Ratio AS DBCorporateActionSplit_Ratio, 
            True AS _from0
        FROM OpenTrader_ForgeModelStoreContainer.DBCorporateActionSplit AS T_0
    ) AS T_0_1");
                                                                                                                                                                                    }
                                                                                                                                                                                    else
                                                                                                                                                                                    {
                                                                                                                                                                                        if
                                                                                                                                                                                            (
                                                                                                                                                                                            (index ==
                                                                                                                                                                                             43))
                                                                                                                                                                                        {
                                                                                                                                                                                            // return view for OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataEquity
                                                                                                                                                                                            return
                                                                                                                                                                                                new KeyValuePair
                                                                                                                                                                                                    <
                                                                                                                                                                                                        string
                                                                                                                                                                                                        , 
                                                                                                                                                                                                        string
                                                                                                                                                                                                        >
                                                                                                                                                                                                    (
                                                                                                                                                                                                    "OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataEquity", 
                                                                                                                                                                                                    @"
    SELECT VALUE -- Constructing DBInstrumentStaticDataEquity
        [OpenTrader_ForgeModel.Store].DBInstrumentStaticDataEquity(T_0_1.DBInstrumentStaticDataEquity_ID, T_0_1.DBInstrumentStaticDataEquity_Type, T_0_1.DBInstrumentStaticDataEquity_Name, T_0_1.DBInstrumentStaticDataEquity_DBMarketID, T_0_1.DBInstrumentStaticDataEquity_DBTickSizeRuleID, T_0_1.DBInstrumentStaticDataEquity_Currency, T_0_1.DBInstrumentStaticDataEquity_Sector)
    FROM (
        SELECT 
            T_0.ID AS DBInstrumentStaticDataEquity_ID, 
            T_0.Type AS DBInstrumentStaticDataEquity_Type, 
            T_0.Name AS DBInstrumentStaticDataEquity_Name, 
            T_0.DBMarketID AS DBInstrumentStaticDataEquity_DBMarketID, 
            T_0.DBTickSizeRuleID AS DBInstrumentStaticDataEquity_DBTickSizeRuleID, 
            T_0.Currency AS DBInstrumentStaticDataEquity_Currency, 
            T_0.Sector AS DBInstrumentStaticDataEquity_Sector, 
            True AS _from0
        FROM OpenTrader_ForgeEntities.DBInstrumentStaticDataEquity AS T_0
    ) AS T_0_1");
                                                                                                                                                                                        }
                                                                                                                                                                                        else
                                                                                                                                                                                        {
                                                                                                                                                                                            if
                                                                                                                                                                                                (
                                                                                                                                                                                                (index ==
                                                                                                                                                                                                 44))
                                                                                                                                                                                            {
                                                                                                                                                                                                // return view for OpenTrader_ForgeEntities.DBInstrumentStaticDataEquity
                                                                                                                                                                                                return
                                                                                                                                                                                                    new KeyValuePair
                                                                                                                                                                                                        <
                                                                                                                                                                                                            string
                                                                                                                                                                                                            , 
                                                                                                                                                                                                            string
                                                                                                                                                                                                            >
                                                                                                                                                                                                        (
                                                                                                                                                                                                        "OpenTrader_ForgeEntities.DBInstrumentStaticDataEquity", 
                                                                                                                                                                                                        @"
    SELECT VALUE -- Constructing DBInstrumentStaticDataEquity
        OpenTrader_ForgeModel.DBInstrumentStaticDataEquity(T_0_1.DBInstrumentStaticDataEquity_ID, T_0_1.DBInstrumentStaticDataEquity_Type, T_0_1.DBInstrumentStaticDataEquity_Name, T_0_1.DBInstrumentStaticDataEquity_DBMarketID, T_0_1.DBInstrumentStaticDataEquity_DBTickSizeRuleID, T_0_1.DBInstrumentStaticDataEquity_Currency, T_0_1.DBInstrumentStaticDataEquity_Sector)
    FROM (
        SELECT 
            T_0.ID AS DBInstrumentStaticDataEquity_ID, 
            T_0.Type AS DBInstrumentStaticDataEquity_Type, 
            T_0.Name AS DBInstrumentStaticDataEquity_Name, 
            T_0.DBMarketID AS DBInstrumentStaticDataEquity_DBMarketID, 
            T_0.DBTickSizeRuleID AS DBInstrumentStaticDataEquity_DBTickSizeRuleID, 
            T_0.Currency AS DBInstrumentStaticDataEquity_Currency, 
            T_0.Sector AS DBInstrumentStaticDataEquity_Sector, 
            True AS _from0
        FROM OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataEquity AS T_0
    ) AS T_0_1");
                                                                                                                                                                                            }
                                                                                                                                                                                            else
                                                                                                                                                                                            {
                                                                                                                                                                                                if
                                                                                                                                                                                                    (
                                                                                                                                                                                                    (index ==
                                                                                                                                                                                                     45))
                                                                                                                                                                                                {
                                                                                                                                                                                                    // return view for OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataEquityIndexFuture
                                                                                                                                                                                                    return
                                                                                                                                                                                                        new KeyValuePair
                                                                                                                                                                                                            <
                                                                                                                                                                                                                string
                                                                                                                                                                                                                , 
                                                                                                                                                                                                                string
                                                                                                                                                                                                                >
                                                                                                                                                                                                            (
                                                                                                                                                                                                            "OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataEquityIndexFuture", 
                                                                                                                                                                                                            @"
    SELECT VALUE -- Constructing DBInstrumentStaticDataEquityIndexFuture
        [OpenTrader_ForgeModel.Store].DBInstrumentStaticDataEquityIndexFuture(T_0_1.DBInstrumentStaticDataEquityIndexFuture_ID, T_0_1.DBInstrumentStaticDataEquityIndexFuture_Type, T_0_1.DBInstrumentStaticDataEquityIndexFuture_Name, T_0_1.DBInstrumentStaticDataEquityIndexFuture_DBMarketID, T_0_1.DBInstrumentStaticDataEquityIndexFuture_DBTickSizeRuleID, T_0_1.DBInstrumentStaticDataEquityIndexFuture_Currency, T_0_1.DBInstrumentStaticDataEquityIndexFuture_Maturity)
    FROM (
        SELECT 
            T_0.ID AS DBInstrumentStaticDataEquityIndexFuture_ID, 
            T_0.Type AS DBInstrumentStaticDataEquityIndexFuture_Type, 
            T_0.Name AS DBInstrumentStaticDataEquityIndexFuture_Name, 
            T_0.DBMarketID AS DBInstrumentStaticDataEquityIndexFuture_DBMarketID, 
            T_0.DBTickSizeRuleID AS DBInstrumentStaticDataEquityIndexFuture_DBTickSizeRuleID, 
            T_0.Currency AS DBInstrumentStaticDataEquityIndexFuture_Currency, 
            T_0.Maturity AS DBInstrumentStaticDataEquityIndexFuture_Maturity, 
            True AS _from0
        FROM OpenTrader_ForgeEntities.DBInstrumentStaticDataEquityIndexFuture AS T_0
    ) AS T_0_1");
                                                                                                                                                                                                }
                                                                                                                                                                                                else
                                                                                                                                                                                                {
                                                                                                                                                                                                    if
                                                                                                                                                                                                        (
                                                                                                                                                                                                        (index ==
                                                                                                                                                                                                         46))
                                                                                                                                                                                                    {
                                                                                                                                                                                                        // return view for OpenTrader_ForgeEntities.DBInstrumentStaticDataEquityIndexFuture
                                                                                                                                                                                                        return
                                                                                                                                                                                                            new KeyValuePair
                                                                                                                                                                                                                <
                                                                                                                                                                                                                    string
                                                                                                                                                                                                                    , 
                                                                                                                                                                                                                    string
                                                                                                                                                                                                                    >
                                                                                                                                                                                                                (
                                                                                                                                                                                                                "OpenTrader_ForgeEntities.DBInstrumentStaticDataEquityIndexFuture", 
                                                                                                                                                                                                                @"
    SELECT VALUE -- Constructing DBInstrumentStaticDataEquityIndexFuture
        OpenTrader_ForgeModel.DBInstrumentStaticDataEquityIndexFuture(T_0_1.DBInstrumentStaticDataEquityIndexFuture_ID, T_0_1.DBInstrumentStaticDataEquityIndexFuture_Type, T_0_1.DBInstrumentStaticDataEquityIndexFuture_Name, T_0_1.DBInstrumentStaticDataEquityIndexFuture_DBMarketID, T_0_1.DBInstrumentStaticDataEquityIndexFuture_DBTickSizeRuleID, T_0_1.DBInstrumentStaticDataEquityIndexFuture_Currency, T_0_1.DBInstrumentStaticDataEquityIndexFuture_Maturity)
    FROM (
        SELECT 
            T_0.ID AS DBInstrumentStaticDataEquityIndexFuture_ID, 
            T_0.Type AS DBInstrumentStaticDataEquityIndexFuture_Type, 
            T_0.Name AS DBInstrumentStaticDataEquityIndexFuture_Name, 
            T_0.DBMarketID AS DBInstrumentStaticDataEquityIndexFuture_DBMarketID, 
            T_0.DBTickSizeRuleID AS DBInstrumentStaticDataEquityIndexFuture_DBTickSizeRuleID, 
            T_0.Currency AS DBInstrumentStaticDataEquityIndexFuture_Currency, 
            T_0.Maturity AS DBInstrumentStaticDataEquityIndexFuture_Maturity, 
            True AS _from0
        FROM OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataEquityIndexFuture AS T_0
    ) AS T_0_1");
                                                                                                                                                                                                    }
                                                                                                                                                                                                    else
                                                                                                                                                                                                    {
                                                                                                                                                                                                        if
                                                                                                                                                                                                            (
                                                                                                                                                                                                            (index ==
                                                                                                                                                                                                             47))
                                                                                                                                                                                                        {
                                                                                                                                                                                                            // return view for OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataEquityVanillaOption
                                                                                                                                                                                                            return
                                                                                                                                                                                                                new KeyValuePair
                                                                                                                                                                                                                    <
                                                                                                                                                                                                                        string
                                                                                                                                                                                                                        , 
                                                                                                                                                                                                                        string
                                                                                                                                                                                                                        >
                                                                                                                                                                                                                    (
                                                                                                                                                                                                                    "OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataEquityVanillaOption", 
                                                                                                                                                                                                                    "\r\n    SELECT VALUE -- Constructing DBInstrumentStaticDataEquityVanillaOption\r\n   " +
                                                                                                                                                                                                                    "     [OpenTrader_ForgeModel.Store].DBInstrumentStaticDataEquityVanillaOption(T_0" +
                                                                                                                                                                                                                    "_1.DBInstrumentStaticDataEquityVanillaOption_ID, T_0_1.DBInstrumentStaticDataEqu" +
                                                                                                                                                                                                                    "ityVanillaOption_Type, T_0_1.DBInstrumentStaticDataEquityVanillaOption_Name, T_0" +
                                                                                                                                                                                                                    "_1.DBInstrumentStaticDataEquityVanillaOption_DBMarketID, T_0_1.DBInstrumentStati" +
                                                                                                                                                                                                                    "cDataEquityVanillaOption_DBTickSizeRuleID, T_0_1.DBInstrumentStaticDataEquityVan" +
                                                                                                                                                                                                                    "illaOption_Currency, T_0_1.DBInstrumentStaticDataEquityVanillaOption_DBUnderlyin" +
                                                                                                                                                                                                                    "gID, T_0_1.DBInstrumentStaticDataEquityVanillaOption_Sector, T_0_1.DBInstrumentS" +
                                                                                                                                                                                                                    "taticDataEquityVanillaOption_OptionType, T_0_1.DBInstrumentStaticDataEquityVanil" +
                                                                                                                                                                                                                    "laOption_ExerciseType, T_0_1.DBInstrumentStaticDataEquityVanillaOption_K, T_0_1." +
                                                                                                                                                                                                                    "DBInstrumentStaticDataEquityVanillaOption_T)\r\n    FROM (\r\n        SELECT \r\n     " +
                                                                                                                                                                                                                    "       T_0.ID AS DBInstrumentStaticDataEquityVanillaOption_ID, \r\n            T_0" +
                                                                                                                                                                                                                    ".Type AS DBInstrumentStaticDataEquityVanillaOption_Type, \r\n            T_0.Name " +
                                                                                                                                                                                                                    "AS DBInstrumentStaticDataEquityVanillaOption_Name, \r\n            T_0.DBMarketID " +
                                                                                                                                                                                                                    "AS DBInstrumentStaticDataEquityVanillaOption_DBMarketID, \r\n            T_0.DBTic" +
                                                                                                                                                                                                                    "kSizeRuleID AS DBInstrumentStaticDataEquityVanillaOption_DBTickSizeRuleID, \r\n   " +
                                                                                                                                                                                                                    "         T_0.Currency AS DBInstrumentStaticDataEquityVanillaOption_Currency, \r\n " +
                                                                                                                                                                                                                    "           T_0.DBUnderlyingID AS DBInstrumentStaticDataEquityVanillaOption_DBUnd" +
                                                                                                                                                                                                                    "erlyingID, \r\n            T_0.Sector AS DBInstrumentStaticDataEquityVanillaOption" +
                                                                                                                                                                                                                    "_Sector, \r\n            T_0.OptionType AS DBInstrumentStaticDataEquityVanillaOpti" +
                                                                                                                                                                                                                    "on_OptionType, \r\n            T_0.ExerciseType AS DBInstrumentStaticDataEquityVan" +
                                                                                                                                                                                                                    "illaOption_ExerciseType, \r\n            T_0.K AS DBInstrumentStaticDataEquityVani" +
                                                                                                                                                                                                                    "llaOption_K, \r\n            T_0.T AS DBInstrumentStaticDataEquityVanillaOption_T," +
                                                                                                                                                                                                                    " \r\n            True AS _from0\r\n        FROM OpenTrader_ForgeEntities.DBInstrumen" +
                                                                                                                                                                                                                    "tStaticDataEquityVanillaOption AS T_0\r\n    ) AS T_0_1");
                                                                                                                                                                                                        }
                                                                                                                                                                                                        else
                                                                                                                                                                                                        {
                                                                                                                                                                                                            if
                                                                                                                                                                                                                (
                                                                                                                                                                                                                (index ==
                                                                                                                                                                                                                 48))
                                                                                                                                                                                                            {
                                                                                                                                                                                                                // return view for OpenTrader_ForgeEntities.DBInstrumentStaticDataEquityVanillaOption
                                                                                                                                                                                                                return
                                                                                                                                                                                                                    new KeyValuePair
                                                                                                                                                                                                                        <
                                                                                                                                                                                                                            string
                                                                                                                                                                                                                            , 
                                                                                                                                                                                                                            string
                                                                                                                                                                                                                            >
                                                                                                                                                                                                                        (
                                                                                                                                                                                                                        "OpenTrader_ForgeEntities.DBInstrumentStaticDataEquityVanillaOption", 
                                                                                                                                                                                                                        "\r\n    SELECT VALUE -- Constructing DBInstrumentStaticDataEquityVanillaOption\r\n   " +
                                                                                                                                                                                                                        "     OpenTrader_ForgeModel.DBInstrumentStaticDataEquityVanillaOption(T_0_1.DBIns" +
                                                                                                                                                                                                                        "trumentStaticDataEquityVanillaOption_ID, T_0_1.DBInstrumentStaticDataEquityVanil" +
                                                                                                                                                                                                                        "laOption_Type, T_0_1.DBInstrumentStaticDataEquityVanillaOption_Name, T_0_1.DBIns" +
                                                                                                                                                                                                                        "trumentStaticDataEquityVanillaOption_DBMarketID, T_0_1.DBInstrumentStaticDataEqu" +
                                                                                                                                                                                                                        "ityVanillaOption_DBTickSizeRuleID, T_0_1.DBInstrumentStaticDataEquityVanillaOpti" +
                                                                                                                                                                                                                        "on_Currency, T_0_1.DBInstrumentStaticDataEquityVanillaOption_DBUnderlyingID, T_0" +
                                                                                                                                                                                                                        "_1.DBInstrumentStaticDataEquityVanillaOption_Sector, T_0_1.DBInstrumentStaticDat" +
                                                                                                                                                                                                                        "aEquityVanillaOption_OptionType, T_0_1.DBInstrumentStaticDataEquityVanillaOption" +
                                                                                                                                                                                                                        "_ExerciseType, T_0_1.DBInstrumentStaticDataEquityVanillaOption_K, T_0_1.DBInstru" +
                                                                                                                                                                                                                        "mentStaticDataEquityVanillaOption_T)\r\n    FROM (\r\n        SELECT \r\n            T" +
                                                                                                                                                                                                                        "_0.ID AS DBInstrumentStaticDataEquityVanillaOption_ID, \r\n            T_0.Type AS" +
                                                                                                                                                                                                                        " DBInstrumentStaticDataEquityVanillaOption_Type, \r\n            T_0.Name AS DBIns" +
                                                                                                                                                                                                                        "trumentStaticDataEquityVanillaOption_Name, \r\n            T_0.DBMarketID AS DBIns" +
                                                                                                                                                                                                                        "trumentStaticDataEquityVanillaOption_DBMarketID, \r\n            T_0.DBTickSizeRul" +
                                                                                                                                                                                                                        "eID AS DBInstrumentStaticDataEquityVanillaOption_DBTickSizeRuleID, \r\n           " +
                                                                                                                                                                                                                        " T_0.Currency AS DBInstrumentStaticDataEquityVanillaOption_Currency, \r\n         " +
                                                                                                                                                                                                                        "   T_0.DBUnderlyingID AS DBInstrumentStaticDataEquityVanillaOption_DBUnderlyingI" +
                                                                                                                                                                                                                        "D, \r\n            T_0.Sector AS DBInstrumentStaticDataEquityVanillaOption_Sector," +
                                                                                                                                                                                                                        " \r\n            T_0.OptionType AS DBInstrumentStaticDataEquityVanillaOption_Optio" +
                                                                                                                                                                                                                        "nType, \r\n            T_0.ExerciseType AS DBInstrumentStaticDataEquityVanillaOpti" +
                                                                                                                                                                                                                        "on_ExerciseType, \r\n            T_0.K AS DBInstrumentStaticDataEquityVanillaOptio" +
                                                                                                                                                                                                                        "n_K, \r\n            T_0.T AS DBInstrumentStaticDataEquityVanillaOption_T, \r\n     " +
                                                                                                                                                                                                                        "       True AS _from0\r\n        FROM OpenTrader_ForgeModelStoreContainer.DBInstru" +
                                                                                                                                                                                                                        "mentStaticDataEquityVanillaOption AS T_0\r\n    ) AS T_0_1");
                                                                                                                                                                                                            }
                                                                                                                                                                                                            else
                                                                                                                                                                                                            {
                                                                                                                                                                                                                if
                                                                                                                                                                                                                    (
                                                                                                                                                                                                                    (index ==
                                                                                                                                                                                                                     49))
                                                                                                                                                                                                                {
                                                                                                                                                                                                                    // return view for OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataForex
                                                                                                                                                                                                                    return
                                                                                                                                                                                                                        new KeyValuePair
                                                                                                                                                                                                                            <
                                                                                                                                                                                                                                string
                                                                                                                                                                                                                                , 
                                                                                                                                                                                                                                string
                                                                                                                                                                                                                                >
                                                                                                                                                                                                                            (
                                                                                                                                                                                                                            "OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataForex", 
                                                                                                                                                                                                                            @"
    SELECT VALUE -- Constructing DBInstrumentStaticDataForex
        [OpenTrader_ForgeModel.Store].DBInstrumentStaticDataForex(T_0_1.DBInstrumentStaticDataForex_ID, T_0_1.DBInstrumentStaticDataForex_Type, T_0_1.DBInstrumentStaticDataForex_Name, T_0_1.DBInstrumentStaticDataForex_DBMarketID, T_0_1.DBInstrumentStaticDataForex_DBTickSizeRuleID, T_0_1.DBInstrumentStaticDataForex_Currency, T_0_1.DBInstrumentStaticDataForex_Currency2)
    FROM (
        SELECT 
            T_0.ID AS DBInstrumentStaticDataForex_ID, 
            T_0.Type AS DBInstrumentStaticDataForex_Type, 
            T_0.Name AS DBInstrumentStaticDataForex_Name, 
            T_0.DBMarketID AS DBInstrumentStaticDataForex_DBMarketID, 
            T_0.DBTickSizeRuleID AS DBInstrumentStaticDataForex_DBTickSizeRuleID, 
            T_0.Currency AS DBInstrumentStaticDataForex_Currency, 
            T_0.Currency2 AS DBInstrumentStaticDataForex_Currency2, 
            True AS _from0
        FROM OpenTrader_ForgeEntities.DBInstrumentStaticDataForex AS T_0
    ) AS T_0_1");
                                                                                                                                                                                                                }
                                                                                                                                                                                                                else
                                                                                                                                                                                                                {
                                                                                                                                                                                                                    if
                                                                                                                                                                                                                        (
                                                                                                                                                                                                                        (index ==
                                                                                                                                                                                                                         50))
                                                                                                                                                                                                                    {
                                                                                                                                                                                                                        // return view for OpenTrader_ForgeEntities.DBInstrumentStaticDataForex
                                                                                                                                                                                                                        return
                                                                                                                                                                                                                            new KeyValuePair
                                                                                                                                                                                                                                <
                                                                                                                                                                                                                                    string
                                                                                                                                                                                                                                    , 
                                                                                                                                                                                                                                    string
                                                                                                                                                                                                                                    >
                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                "OpenTrader_ForgeEntities.DBInstrumentStaticDataForex", 
                                                                                                                                                                                                                                @"
    SELECT VALUE -- Constructing DBInstrumentStaticDataForex
        OpenTrader_ForgeModel.DBInstrumentStaticDataForex(T_0_1.DBInstrumentStaticDataForex_ID, T_0_1.DBInstrumentStaticDataForex_Type, T_0_1.DBInstrumentStaticDataForex_Name, T_0_1.DBInstrumentStaticDataForex_DBMarketID, T_0_1.DBInstrumentStaticDataForex_DBTickSizeRuleID, T_0_1.DBInstrumentStaticDataForex_Currency, T_0_1.DBInstrumentStaticDataForex_Currency2)
    FROM (
        SELECT 
            T_0.ID AS DBInstrumentStaticDataForex_ID, 
            T_0.Type AS DBInstrumentStaticDataForex_Type, 
            T_0.Name AS DBInstrumentStaticDataForex_Name, 
            T_0.DBMarketID AS DBInstrumentStaticDataForex_DBMarketID, 
            T_0.DBTickSizeRuleID AS DBInstrumentStaticDataForex_DBTickSizeRuleID, 
            T_0.Currency AS DBInstrumentStaticDataForex_Currency, 
            T_0.Currency2 AS DBInstrumentStaticDataForex_Currency2, 
            True AS _from0
        FROM OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataForex AS T_0
    ) AS T_0_1");
                                                                                                                                                                                                                    }
                                                                                                                                                                                                                    else
                                                                                                                                                                                                                    {
                                                                                                                                                                                                                        if
                                                                                                                                                                                                                            (
                                                                                                                                                                                                                            (index ==
                                                                                                                                                                                                                             51))
                                                                                                                                                                                                                        {
                                                                                                                                                                                                                            // return view for OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataForexFuture
                                                                                                                                                                                                                            return
                                                                                                                                                                                                                                new KeyValuePair
                                                                                                                                                                                                                                    <
                                                                                                                                                                                                                                        string
                                                                                                                                                                                                                                        , 
                                                                                                                                                                                                                                        string
                                                                                                                                                                                                                                        >
                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                    "OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataForexFuture", 
                                                                                                                                                                                                                                    @"
    SELECT VALUE -- Constructing DBInstrumentStaticDataForexFuture
        [OpenTrader_ForgeModel.Store].DBInstrumentStaticDataForexFuture(T_0_1.DBInstrumentStaticDataForexFuture_ID, T_0_1.DBInstrumentStaticDataForexFuture_Type, T_0_1.DBInstrumentStaticDataForexFuture_Name, T_0_1.DBInstrumentStaticDataForexFuture_DBMarketID, T_0_1.DBInstrumentStaticDataForexFuture_DBTickSizeRuleID, T_0_1.DBInstrumentStaticDataForexFuture_Currency, T_0_1.DBInstrumentStaticDataForexFuture_Currency2, T_0_1.DBInstrumentStaticDataForexFuture_Maturity)
    FROM (
        SELECT 
            T_0.ID AS DBInstrumentStaticDataForexFuture_ID, 
            T_0.Type AS DBInstrumentStaticDataForexFuture_Type, 
            T_0.Name AS DBInstrumentStaticDataForexFuture_Name, 
            T_0.DBMarketID AS DBInstrumentStaticDataForexFuture_DBMarketID, 
            T_0.DBTickSizeRuleID AS DBInstrumentStaticDataForexFuture_DBTickSizeRuleID, 
            T_0.Currency AS DBInstrumentStaticDataForexFuture_Currency, 
            T_0.Currency2 AS DBInstrumentStaticDataForexFuture_Currency2, 
            T_0.Maturity AS DBInstrumentStaticDataForexFuture_Maturity, 
            True AS _from0
        FROM OpenTrader_ForgeEntities.DBInstrumentStaticDataForexFuture AS T_0
    ) AS T_0_1");
                                                                                                                                                                                                                        }
                                                                                                                                                                                                                        else
                                                                                                                                                                                                                        {
                                                                                                                                                                                                                            if
                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                (index ==
                                                                                                                                                                                                                                 52))
                                                                                                                                                                                                                            {
                                                                                                                                                                                                                                // return view for OpenTrader_ForgeEntities.DBInstrumentStaticDataForexFuture
                                                                                                                                                                                                                                return
                                                                                                                                                                                                                                    new KeyValuePair
                                                                                                                                                                                                                                        <
                                                                                                                                                                                                                                            string
                                                                                                                                                                                                                                            , 
                                                                                                                                                                                                                                            string
                                                                                                                                                                                                                                            >
                                                                                                                                                                                                                                        (
                                                                                                                                                                                                                                        "OpenTrader_ForgeEntities.DBInstrumentStaticDataForexFuture", 
                                                                                                                                                                                                                                        @"
    SELECT VALUE -- Constructing DBInstrumentStaticDataForexFuture
        OpenTrader_ForgeModel.DBInstrumentStaticDataForexFuture(T_0_1.DBInstrumentStaticDataForexFuture_ID, T_0_1.DBInstrumentStaticDataForexFuture_Type, T_0_1.DBInstrumentStaticDataForexFuture_Name, T_0_1.DBInstrumentStaticDataForexFuture_DBMarketID, T_0_1.DBInstrumentStaticDataForexFuture_DBTickSizeRuleID, T_0_1.DBInstrumentStaticDataForexFuture_Currency, T_0_1.DBInstrumentStaticDataForexFuture_Currency2, T_0_1.DBInstrumentStaticDataForexFuture_Maturity)
    FROM (
        SELECT 
            T_0.ID AS DBInstrumentStaticDataForexFuture_ID, 
            T_0.Type AS DBInstrumentStaticDataForexFuture_Type, 
            T_0.Name AS DBInstrumentStaticDataForexFuture_Name, 
            T_0.DBMarketID AS DBInstrumentStaticDataForexFuture_DBMarketID, 
            T_0.DBTickSizeRuleID AS DBInstrumentStaticDataForexFuture_DBTickSizeRuleID, 
            T_0.Currency AS DBInstrumentStaticDataForexFuture_Currency, 
            T_0.Currency2 AS DBInstrumentStaticDataForexFuture_Currency2, 
            T_0.Maturity AS DBInstrumentStaticDataForexFuture_Maturity, 
            True AS _from0
        FROM OpenTrader_ForgeModelStoreContainer.DBInstrumentStaticDataForexFuture AS T_0
    ) AS T_0_1");
                                                                                                                                                                                                                            }
                                                                                                                                                                                                                        }
                                                                                                                                                                                                                    }
                                                                                                                                                                                                                }
                                                                                                                                                                                                            }
                                                                                                                                                                                                        }
                                                                                                                                                                                                    }
                                                                                                                                                                                                }
                                                                                                                                                                                            }
                                                                                                                                                                                        }
                                                                                                                                                                                    }
                                                                                                                                                                                }
                                                                                                                                                                            }
                                                                                                                                                                        }
                                                                                                                                                                    }
                                                                                                                                                                }
                                                                                                                                                            }
                                                                                                                                                        }
                                                                                                                                                    }
                                                                                                                                                }
                                                                                                                                            }
                                                                                                                                        }
                                                                                                                                    }
                                                                                                                                }
                                                                                                                            }
                                                                                                                        }
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            throw new IndexOutOfRangeException();
        }

        #endregion
    }
}